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

Function test_skip_reasons_folding

testing/test_terminal.py:2520–2551  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2518
2519
2520def test_skip_reasons_folding() -> None:
2521 path = "xyz"
2522 lineno = 3
2523 message = "justso"
2524 longrepr = (path, lineno, message)
2525
2526 class X:
2527 pass
2528
2529 ev1 = cast(CollectReport, X())
2530 ev1.when = "execute"
2531 ev1.skipped = True # type: ignore[misc]
2532 ev1.longrepr = longrepr
2533
2534 ev2 = cast(CollectReport, X())
2535 ev2.when = "execute"
2536 ev2.longrepr = longrepr
2537 ev2.skipped = True # type: ignore[misc]
2538
2539 # ev3 might be a collection report
2540 ev3 = cast(CollectReport, X())
2541 ev3.when = "collect"
2542 ev3.longrepr = longrepr
2543 ev3.skipped = True # type: ignore[misc]
2544
2545 values = _folded_skips(Path.cwd(), [ev1, ev2, ev3])
2546 assert len(values) == 1
2547 num, fspath, lineno_, reason = values[0]
2548 assert num == 3
2549 assert fspath == path
2550 assert lineno_ == lineno
2551 assert reason == message
2552
2553
2554def test_line_with_reprcrash(monkeypatch: MonkeyPatch) -> None:

Callers

nothing calls this directly

Calls 2

_folded_skipsFunction · 0.90
XClass · 0.70

Tested by

no test coverage detected