(
pytester: Pytester, monkeypatch, use_ci: bool, expected_message: str
)
| 1232 | ids=("on CI", "not on CI"), |
| 1233 | ) |
| 1234 | def 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 | |
| 1254 | def test_fail_reporting_on_pass(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected