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

Function test_short_summary_with_verbose

testing/test_terminal.py:2635–2669  ·  view source on GitHub ↗

With -vv do not truncate the summary info (#11777).

(
    monkeypatch: MonkeyPatch, pytester: Pytester
)

Source from the content-addressed store, hash-verified

2633
2634
2635def test_short_summary_with_verbose(
2636 monkeypatch: MonkeyPatch, pytester: Pytester
2637) -> None:
2638 """With -vv do not truncate the summary info (#11777)."""
2639 # On CI we also do not truncate the summary info, monkeypatch it to ensure we
2640 # are testing against the -vv flag on CI.
2641 monkeypatch.setattr(_pytest.terminal, "running_on_ci", lambda: False)
2642
2643 string_length = 200
2644 pytester.makepyfile(
2645 f"""
2646 def test():
2647 s1 = "A" * {string_length}
2648 s2 = "B" * {string_length}
2649 assert s1 == s2
2650 """
2651 )
2652
2653 # No -vv, summary info should be truncated.
2654 result = pytester.runpytest()
2655 result.stdout.fnmatch_lines(
2656 [
2657 "*short test summary info*",
2658 "* assert 'AAA...",
2659 ],
2660 )
2661
2662 # No truncation with -vv.
2663 result = pytester.runpytest("-vv")
2664 result.stdout.fnmatch_lines(
2665 [
2666 "*short test summary info*",
2667 f"*{'A' * string_length}*{'B' * string_length}'",
2668 ]
2669 )
2670
2671
2672def test_full_sequence_print_with_vv(

Callers

nothing calls this directly

Calls 4

setattrMethod · 0.80
fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…