generate_tests: always use call_extra

- its a noop addition in the methods is empty list
This commit is contained in:
Ronny Pfannschmidt 2019-07-12 17:44:17 +02:00
parent 13d750db20
commit 4480d3e518
1 changed files with 2 additions and 6 deletions

View File

@ -391,12 +391,8 @@ class PyCollector(PyobjMixin, nodes.Collector):
methods.append(module.pytest_generate_tests)
if hasattr(cls, "pytest_generate_tests"):
methods.append(cls().pytest_generate_tests)
if methods:
self.ihook.pytest_generate_tests.call_extra(
methods, dict(metafunc=metafunc)
)
else:
self.ihook.pytest_generate_tests(metafunc=metafunc)
self.ihook.pytest_generate_tests.call_extra(methods, dict(metafunc=metafunc))
if not metafunc._calls:
yield Function(name, parent=self, fixtureinfo=fixtureinfo)