@@ -660,8 +660,7 @@ def test_pkgfile(self, pytester: Pytester) -> None:
660
660
subdir = tmp_path .joinpath ("subdir" )
661
661
x = ensure_file (subdir / "x.py" )
662
662
ensure_file (subdir / "__init__.py" )
663
- with subdir .cwd ():
664
- config = pytester .parseconfigure (x )
663
+ config = pytester .parseconfigure (x )
665
664
col = pytester .getnode (config , x )
666
665
assert col is not None
667
666
assert col .name == "x.py"
@@ -1188,8 +1187,7 @@ def test_1():
1188
1187
"""
1189
1188
% (str (subdir ),)
1190
1189
)
1191
- with pytester .path .cwd ():
1192
- result = pytester .runpytest ()
1190
+ result = pytester .runpytest ()
1193
1191
result .stdout .fnmatch_lines (["*1 passed in*" ])
1194
1192
assert result .ret == 0
1195
1193
@@ -1200,8 +1198,7 @@ def test_1():
1200
1198
testpaths = .
1201
1199
"""
1202
1200
)
1203
- with pytester .path .cwd ():
1204
- result = pytester .runpytest ("--collect-only" )
1201
+ result = pytester .runpytest ("--collect-only" )
1205
1202
result .stdout .fnmatch_lines (["collected 1 item" ])
1206
1203
1207
1204
@@ -1224,8 +1221,7 @@ def test_collect_pyargs_with_testpaths(
1224
1221
)
1225
1222
)
1226
1223
monkeypatch .setenv ("PYTHONPATH" , str (pytester .path ), prepend = os .pathsep )
1227
- with root .cwd ():
1228
- result = pytester .runpytest_subprocess ()
1224
+ result = pytester .runpytest_subprocess ()
1229
1225
result .stdout .fnmatch_lines (["*1 passed in*" ])
1230
1226
1231
1227
0 commit comments