-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
staticmethod functions are not collected for testing #2528
Copy link
Copy link
Closed
Description
When using classes to group functions, I'm interested in this pattern:
"test_http_requests.py"
class TestGet:
@staticmethod
def test_simple_get():
pass
@staticmethod
def test_query_string():
pass
class TestPut:
@staticmethod
def test_no_data():
pass
@staticmethod
def test_binary_data():
passUsing the @staticmethod decorator makes it clear that I'm not using the class for anything but grouping.
Unfortunately, pytest fails to collect any method so decorated. If I remove the decorator and add the self argument in the above example, pytest collects as expected.
Pytest 3.1.2, Python 2.7.13, no virtualenv, MacOS 10.12.5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels