From 4480d3e51805e60f4645017242495d9fc3b21331 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Fri, 12 Jul 2019 17:44:17 +0200 Subject: [PATCH] generate_tests: always use call_extra - its a noop addition in the methods is empty list --- src/_pytest/python.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 8ca15fb0f..293194c68 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -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)