{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/3758","repository_url":"https://api.github.com/repos/pytest-dev/pytest","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3758/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3758/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3758/events","html_url":"https://github.com/pytest-dev/pytest/issues/3758","id":346515016,"node_id":"MDU6SXNzdWUzNDY1MTUwMTY=","number":3758,"title":"[Question] : Is there a way to find all markers associated with a particular test function?","user":{"login":"thakkardharmik","id":29972208,"node_id":"MDQ6VXNlcjI5OTcyMjA4","avatar_url":"https://avatars0.githubusercontent.com/u/29972208?v=4","gravatar_id":"","url":"https://api.github.com/users/thakkardharmik","html_url":"https://github.com/thakkardharmik","followers_url":"https://api.github.com/users/thakkardharmik/followers","following_url":"https://api.github.com/users/thakkardharmik/following{/other_user}","gists_url":"https://api.github.com/users/thakkardharmik/gists{/gist_id}","starred_url":"https://api.github.com/users/thakkardharmik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thakkardharmik/subscriptions","organizations_url":"https://api.github.com/users/thakkardharmik/orgs","repos_url":"https://api.github.com/users/thakkardharmik/repos","events_url":"https://api.github.com/users/thakkardharmik/events{/privacy}","received_events_url":"https://api.github.com/users/thakkardharmik/received_events","type":"User","site_admin":false},"labels":[{"id":604254876,"node_id":"MDU6TGFiZWw2MDQyNTQ4NzY=","url":"https://api.github.com/repos/pytest-dev/pytest/labels/topic:%20marks","name":"topic: marks","color":"b60205","default":false},{"id":224849198,"node_id":"MDU6TGFiZWwyMjQ4NDkxOTg=","url":"https://api.github.com/repos/pytest-dev/pytest/labels/type:%20question","name":"type: question","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-01T09:15:24Z","updated_at":"2018-08-01T09:36:17Z","closed_at":null,"author_association":"NONE","body":"Is it possible to collect all the markers that are used with a particular test function along with marker arguments?\r\n\r\n```\r\n@pytest.mark.m1('abc')\r\n@pytest.mark.skipif('True')\r\ndef test_1():\r\n    pass\r\n```\r\nI can collect all the tests with a particular marker using --collect-only -m marker_name.\r\nHowever given a test function eg. test_1 I want the list of markers i.e. [m1('abc') , skipif('True')].\r\n\r\nThanks in advance!"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/comments/409515220","html_url":"https://github.com/pytest-dev/pytest/issues/3758#issuecomment-409515220","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3758","id":409515220,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTUxNTIyMA==","user":{"login":"RonnyPfannschmidt","id":156838,"node_id":"MDQ6VXNlcjE1NjgzOA==","avatar_url":"https://avatars1.githubusercontent.com/u/156838?v=4","gravatar_id":"","url":"https://api.github.com/users/RonnyPfannschmidt","html_url":"https://github.com/RonnyPfannschmidt","followers_url":"https://api.github.com/users/RonnyPfannschmidt/followers","following_url":"https://api.github.com/users/RonnyPfannschmidt/following{/other_user}","gists_url":"https://api.github.com/users/RonnyPfannschmidt/gists{/gist_id}","starred_url":"https://api.github.com/users/RonnyPfannschmidt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RonnyPfannschmidt/subscriptions","organizations_url":"https://api.github.com/users/RonnyPfannschmidt/orgs","repos_url":"https://api.github.com/users/RonnyPfannschmidt/repos","events_url":"https://api.github.com/users/RonnyPfannschmidt/events{/privacy}","received_events_url":"https://api.github.com/users/RonnyPfannschmidt/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T09:36:17Z","updated_at":"2018-08-01T09:36:17Z","author_association":"MEMBER","body":"@thakkardharmik there is no cli option to do it,\r\n\r\nbut given the test items for the makers you can do `list(item.iter_markers())` or `list(item.iter_markers_with_node())`"}}
{"actor":{"display_login":"RonnyPfannschmidt"}}