@@ -660,8 +660,7 @@ def test_pkgfile(self, pytester: Pytester) -> None:
660660 subdir = tmp_path .joinpath ("subdir" )
661661 x = ensure_file (subdir / "x.py" )
662662 ensure_file (subdir / "__init__.py" )
663- with subdir .cwd ():
664- config = pytester .parseconfigure (x )
663+ config = pytester .parseconfigure (x )
665664 col = pytester .getnode (config , x )
666665 assert col is not None
667666 assert col .name == "x.py"
@@ -1188,8 +1187,7 @@ def test_1():
11881187 """
11891188 % (str (subdir ),)
11901189 )
1191- with pytester .path .cwd ():
1192- result = pytester .runpytest ()
1190+ result = pytester .runpytest ()
11931191 result .stdout .fnmatch_lines (["*1 passed in*" ])
11941192 assert result .ret == 0
11951193
@@ -1200,8 +1198,7 @@ def test_1():
12001198 testpaths = .
12011199 """
12021200 )
1203- with pytester .path .cwd ():
1204- result = pytester .runpytest ("--collect-only" )
1201+ result = pytester .runpytest ("--collect-only" )
12051202 result .stdout .fnmatch_lines (["collected 1 item" ])
12061203
12071204
@@ -1224,8 +1221,7 @@ def test_collect_pyargs_with_testpaths(
12241221 )
12251222 )
12261223 monkeypatch .setenv ("PYTHONPATH" , str (pytester .path ), prepend = os .pathsep )
1227- with root .cwd ():
1228- result = pytester .runpytest_subprocess ()
1224+ result = pytester .runpytest_subprocess ()
12291225 result .stdout .fnmatch_lines (["*1 passed in*" ])
12301226
12311227
0 commit comments