{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/3537","repository_url":"https://api.github.com/repos/pytest-dev/pytest","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3537/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3537/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3537/events","html_url":"https://github.com/pytest-dev/pytest/issues/3537","id":329503677,"node_id":"MDU6SXNzdWUzMjk1MDM2Nzc=","number":3537,"title":"Test collection fails when using pytest.mark.usefixtures and a test function is a classmethod","user":{"login":"konoufo","id":9636748,"node_id":"MDQ6VXNlcjk2MzY3NDg=","avatar_url":"https://avatars2.githubusercontent.com/u/9636748?v=4","gravatar_id":"","url":"https://api.github.com/users/konoufo","html_url":"https://github.com/konoufo","followers_url":"https://api.github.com/users/konoufo/followers","following_url":"https://api.github.com/users/konoufo/following{/other_user}","gists_url":"https://api.github.com/users/konoufo/gists{/gist_id}","starred_url":"https://api.github.com/users/konoufo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konoufo/subscriptions","organizations_url":"https://api.github.com/users/konoufo/orgs","repos_url":"https://api.github.com/users/konoufo/repos","events_url":"https://api.github.com/users/konoufo/events{/privacy}","received_events_url":"https://api.github.com/users/konoufo/received_events","type":"User","site_admin":false},"labels":[{"id":224849193,"node_id":"MDU6TGFiZWwyMjQ4NDkxOTM=","url":"https://api.github.com/repos/pytest-dev/pytest/labels/type:%20bug","name":"type: bug","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-06-05T15:14:49Z","updated_at":"2018-06-07T02:18:56Z","closed_at":null,"author_association":"NONE","body":"This minimal example using django TestCase class causes an error on collection:\r\n```python\r\nfrom django.test import TestCase\r\nimport pytest\r\n\r\n\r\n@pytest.fixture\r\ndef harry_potter(request):\r\n    return 1\r\n\r\n\r\n@pytest.mark.usefixtures('harry_potter')\r\nclass FooTestCase(TestCase):\r\n    @classmethod\r\n    def test_foo(cls):\r\n        assert 1\r\n\r\n```\r\n\r\nThe output of running `pytest` is as such:\r\n```\r\nplatform linux -- Python 3.6.5, pytest-3.6.1, py-1.5.3, pluggy-0.6.0\r\nDjango settings: project.settings.development (from ini file)\r\nrootdir: /users/username/project/src, inifile: pytest.ini\r\nplugins: django-3.2.1, celery-4.1.1\r\ncollected 11 items / 1 errors                                                                                                                                                                                                               \r\n\r\n================================================================================================================== ERRORS ===================================================================================================================\r\n_______________________________________________________________________________________________ ERROR collecting tests/fooTestCase.py ________________________________________________________________________________________________\r\n../../../../../.virtualenvs/myvenv/lib/python3.6/site-packages/_pytest/runner.py:198: in __init__\r\n    self.result = func()\r\n../../../../../.virtualenvs/myvenv/lib/python3.6/site-packages/_pytest/runner.py:419: in <lambda>\r\n    call = CallInfo(lambda: list(collector.collect()), \"collect\")\r\n../../../../../.virtualenvs/myvenv/lib/python3.6/site-packages/_pytest/unittest.py:57: in collect\r\n    transfer_markers(funcobj, cls, module)\r\n../../../../../.virtualenvs/myvenv/lib/python3.6/site-packages/_pytest/mark/structures.py:265: in transfer_markers\r\n    store_legacy_markinfo(funcobj, mark)\r\n../../../../../.virtualenvs/myvenv/lib/python3.6/site-packages/_pytest/mark/structures.py:248: in store_legacy_markinfo\r\n    setattr(func, mark.name, holder)\r\nE   AttributeError: 'method' object has no attribute 'usefixtures'\r\n\r\n```\r\nOS: Fedora 27\r\n(See log output for everything else)\r\nIf no test function is a `classmethod` it works alright. I don't know if this is a feature. Nothing seems to imply that.\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/comments/395271301","html_url":"https://github.com/pytest-dev/pytest/issues/3537#issuecomment-395271301","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3537","id":395271301,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTI3MTMwMQ==","user":{"login":"konoufo","id":9636748,"node_id":"MDQ6VXNlcjk2MzY3NDg=","avatar_url":"https://avatars2.githubusercontent.com/u/9636748?v=4","gravatar_id":"","url":"https://api.github.com/users/konoufo","html_url":"https://github.com/konoufo","followers_url":"https://api.github.com/users/konoufo/followers","following_url":"https://api.github.com/users/konoufo/following{/other_user}","gists_url":"https://api.github.com/users/konoufo/gists{/gist_id}","starred_url":"https://api.github.com/users/konoufo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konoufo/subscriptions","organizations_url":"https://api.github.com/users/konoufo/orgs","repos_url":"https://api.github.com/users/konoufo/repos","events_url":"https://api.github.com/users/konoufo/events{/privacy}","received_events_url":"https://api.github.com/users/konoufo/received_events","type":"User","site_admin":false},"created_at":"2018-06-07T02:18:56Z","updated_at":"2018-06-07T02:18:56Z","author_association":"NONE","body":"Yeah alright ^^.  I'll submit a PR soon. Thanks."}}
{"actor":{"display_login":"konoufo"}}