(
tr: TerminalReporter,
exp_line: list[tuple[str, dict[str, bool]]],
exp_color: str,
stats_arg: dict[str, list[object]],
)
| 2015 | ], |
| 2016 | ) |
| 2017 | def 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 | |
| 2043 | def test_skip_counting_towards_summary(tr): |
nothing calls this directly
no test coverage detected