diff --git a/testing/python/collect.py b/testing/python/collect.py index b003f16ab79..e76232055bc 100644 --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -1081,7 +1081,7 @@ def reportinfo(self): return "ABCDE", 42, "custom" def pytest_pycollect_makeitem(collector, name, obj): if name == "test_func": - return MyFunction.from_parent(name=name, parent=collector) + return MyFunction(name, parent=collector) """ ) item = testdir.getitem("def test_func(): pass") diff --git a/testing/test_nodes.py b/testing/test_nodes.py index 5a0bad6f259..1bff51f4bce 100644 --- a/testing/test_nodes.py +++ b/testing/test_nodes.py @@ -21,11 +21,11 @@ def test_ischildnode(baseid, nodeid, expected): assert result is expected -def test_node_from_parent_disallowed_arguments(): +def test_node_from_parent_disallowed_arguments() -> None: with pytest.raises(TypeError, match="session is"): - nodes.Node.from_parent(None, session=None) + nodes.Node.from_parent(None, session=None) # type: ignore[arg-type] with pytest.raises(TypeError, match="config is"): - nodes.Node.from_parent(None, config=None) + nodes.Node.from_parent(None, config=None) # type: ignore[arg-type] def test_std_warn_not_pytestwarning(testdir): @@ -66,7 +66,7 @@ def runtest(self): assert 0, "failure" def pytest_collect_file(path, parent): - return MyItem.from_parent(parent, name="foo") + return MyItem("foo", parent) """ ) diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 48bbc5b99fe..f1f66d1d53a 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -1230,7 +1230,7 @@ def runtest(self): pytest.fail("failure") def pytest_collect_file(path, parent): - return MyItem.from_parent(parent, name="fooitem") + return MyItem("fooitem", parent) """ ) result = testdir.runpytest("-p", "pytester", str(p1))