MCPcopy
hub / github.com/pytest-dev/pytest / test_fail_extra_reporting

Function test_fail_extra_reporting

testing/test_terminal.py:1234–1251  ·  view source on GitHub ↗
(
    pytester: Pytester, monkeypatch, use_ci: bool, expected_message: str
)

Source from the content-addressed store, hash-verified

1232 ids=("on CI", "not on CI"),
1233)
1234def test_fail_extra_reporting(
1235 pytester: Pytester, monkeypatch, use_ci: bool, expected_message: str
1236) -> None:
1237 if use_ci:
1238 monkeypatch.setenv("CI", "true")
1239 else:
1240 monkeypatch.delenv("CI", raising=False)
1241 monkeypatch.setenv("COLUMNS", "80")
1242 pytester.makepyfile("def test_this(): assert 0, 'this_failed' * 100")
1243 result = pytester.runpytest("-rN")
1244 result.stdout.no_fnmatch_line("*short test summary*")
1245 result = pytester.runpytest()
1246 result.stdout.fnmatch_lines(
1247 [
1248 "*test summary*",
1249 f"FAILED test_fail_extra_reporting.py::test_this {expected_message}",
1250 ]
1251 )
1252
1253
1254def test_fail_reporting_on_pass(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 6

setenvMethod · 0.80
delenvMethod · 0.80
no_fnmatch_lineMethod · 0.80
fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected