-
- Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
I ran pytest 3.6.0 with python 3.4 on redhat 6.
I have a module pytest_tasks.py and a test class named 'TestClassOne', in which there's a testcase named 'test_success'. And I wrote a plugin with pytest_runtest_logreport() hook.
If I define a setup_method(self, method) in TestClassOne, then in pytest_runtest_logreport(self, report) I can get:
report.when == 'setup'
report.nodeid == 'pytest_tasks.py::TestClassOne::()::test_success'
I think this information is correct.
If I define a classmethod setup_class(cls), or a setup_module(module) in module scope, then I would expect to have report.nodeid equal to 'pytest_tasks.py::TestClassOne' and 'pytest_tasks.py' respectively, because the setup() works in suite scope or module scope, but the value is always 'pytest_tasks.py::TestClassOne::()::test_success'. So when I get a setup report I don't know which level it is, how can I get the correct information ?