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

Function test_summary_stats

testing/test_terminal.py:2017–2040  ·  view source on GitHub ↗
(
    tr: TerminalReporter,
    exp_line: list[tuple[str, dict[str, bool]]],
    exp_color: str,
    stats_arg: dict[str, list[object]],
)

Source from the content-addressed store, hash-verified

2015 ],
2016)
2017def test_summary_stats(
2018 tr: TerminalReporter,
2019 exp_line: list[tuple[str, dict[str, bool]]],
2020 exp_color: str,
2021 stats_arg: dict[str, list[object]],
2022) -> None:
2023 tr.stats = stats_arg
2024
2025 # Fake "_is_last_item" to be True.
2026 class fake_session:
2027 testscollected = 0
2028
2029 tr._session = fake_session # type: ignore[assignment]
2030 assert tr._is_last_item
2031
2032 # Reset cache.
2033 tr._main_color = None
2034
2035 print(f"Based on stats: {stats_arg}")
2036 print(f'Expect summary: "{exp_line}"; with color "{exp_color}"')
2037 (line, color) = tr.build_summary_stats_line()
2038 print(f'Actually got: "{line}"; with color "{color}"')
2039 assert line == exp_line
2040 assert color == exp_color
2041
2042
2043def test_skip_counting_towards_summary(tr):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected