diff --git a/testing/python/collect.py b/testing/python/collect.py index 22ac6464b..4256851e2 100644 --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -274,7 +274,7 @@ class TestFunction: pytester.makepyfile( """ class A(object): - def __call__(self): + def __call__(self, tmp_path): 0/0 test_a = A() diff --git a/testing/python/integration.py b/testing/python/integration.py index 77ebfa23e..1ab2149ff 100644 --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -234,7 +234,7 @@ class TestMockDecoration: @mock.patch("os.path.abspath") @mock.patch("os.path.normpath") @mock.patch("os.path.basename", new=mock_basename) - def test_someting(normpath, abspath): + def test_someting(normpath, abspath, tmp_path): abspath.return_value = "this" os.path.normpath(os.path.abspath("hello")) normpath.assert_any_call("this") diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 80f2a6d0b..3497b7cc4 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -44,15 +44,15 @@ class TestConftestValueAccessGlobal: def basedir( self, request, tmp_path_factory: TempPathFactory ) -> Generator[Path, None, None]: - tmpdir = tmp_path_factory.mktemp("basedir", numbered=True) - tmpdir.joinpath("adir/b").mkdir(parents=True) - tmpdir.joinpath("adir/conftest.py").write_text("a=1 ; Directory = 3") - tmpdir.joinpath("adir/b/conftest.py").write_text("b=2 ; a = 1.5") + tmp_path = tmp_path_factory.mktemp("basedir", numbered=True) + tmp_path.joinpath("adir/b").mkdir(parents=True) + tmp_path.joinpath("adir/conftest.py").write_text("a=1 ; Directory = 3") + tmp_path.joinpath("adir/b/conftest.py").write_text("b=2 ; a = 1.5") if request.param == "inpackage": - tmpdir.joinpath("adir/__init__.py").touch() - tmpdir.joinpath("adir/b/__init__.py").touch() + tmp_path.joinpath("adir/__init__.py").touch() + tmp_path.joinpath("adir/b/__init__.py").touch() - yield tmpdir + yield tmp_path def test_basic_init(self, basedir: Path) -> None: conftest = PytestPluginManager()