diff --git a/py/test/plugin/api.py b/py/test/plugin/api.py index db27921bc..3ed8694fe 100644 --- a/py/test/plugin/api.py +++ b/py/test/plugin/api.py @@ -49,9 +49,9 @@ class PluginHooks: def pytest_collect_directory(self, path, parent): """ return Collection node or None. """ - def pytest_pymodule_makeitem(self, modcol, name, obj): + def pytest_pycollect_obj(self, collector, name, obj): """ return custom item/collector for a python object in a module, or None. """ - pytest_pymodule_makeitem.firstresult = True + pytest_pycollect_obj.firstresult = True def pytest_collectstart(self, collector): """ collector starts collecting. """ diff --git a/py/test/plugin/pytest_unittest.py b/py/test/plugin/pytest_unittest.py index b9671304b..86602c643 100644 --- a/py/test/plugin/pytest_unittest.py +++ b/py/test/plugin/pytest_unittest.py @@ -18,9 +18,9 @@ import py class UnittestPlugin: """ discover and integrate traditional ``unittest.py`` tests. """ - def pytest_pymodule_makeitem(self, modcol, name, obj): + def pytest_pycollect_obj(self, collector, name, obj): if py.std.inspect.isclass(obj) and issubclass(obj, py.std.unittest.TestCase): - return UnitTestCase(name, parent=modcol) + return UnitTestCase(name, parent=collector) class UnitTestCase(py.test.collect.Class): def collect(self): diff --git a/py/test/pycollect.py b/py/test/pycollect.py index 47b5185dc..da5840553 100644 --- a/py/test/pycollect.py +++ b/py/test/pycollect.py @@ -135,8 +135,8 @@ class PyCollectorMixin(PyobjMixin, py.test.collect.Collector): return self.join(name) def makeitem(self, name, obj): - res = self.config.hook.pytest_pymodule_makeitem( - modcol=self, name=name, obj=obj) + res = self.config.hook.pytest_pycollect_obj( + collector=self, name=name, obj=obj) if res: return res if (self.classnamefilter(name)) and \