MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_cwd_deleted

Function test_cwd_deleted

testing/code/test_excinfo.py:1383–1397  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1381
1382
1383def test_cwd_deleted(pytester: Pytester) -> None:
1384 pytester.makepyfile(
1385 """
1386 import os
1387
1388 def test(tmp_path):
1389 os.chdir(tmp_path)
1390 tmp_path.unlink()
1391 assert False
1392 """
1393 )
1394 result = pytester.runpytest()
1395 result.stdout.fnmatch_lines(["* 1 failed in *"])
1396 result.stdout.no_fnmatch_line("*INTERNALERROR*")
1397 result.stderr.no_fnmatch_line("*INTERNALERROR*")
1398
1399
1400def test_regression_nagative_line_index(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
no_fnmatch_lineMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected