With -vv do not truncate the summary info (#11777).
(
monkeypatch: MonkeyPatch, pytester: Pytester
)
| 2633 | |
| 2634 | |
| 2635 | def 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 | |
| 2672 | def test_full_sequence_print_with_vv( |
nothing calls this directly
no test coverage detected
searching dependent graphs…