MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_summary_stats

Function test_summary_stats

testing/test_terminal.py:1833–1856  ·  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

1831 ],
1832)
1833def test_summary_stats(
1834 tr: TerminalReporter,
1835 exp_line: List[Tuple[str, Dict[str, bool]]],
1836 exp_color: str,
1837 stats_arg: Dict[str, List[object]],
1838) -> None:
1839 tr.stats = stats_arg
1840
1841 # Fake "_is_last_item" to be True.
1842 class fake_session:
1843 testscollected = 0
1844
1845 tr._session = fake_session # type: ignore[assignment]
1846 assert tr._is_last_item
1847
1848 # Reset cache.
1849 tr._main_color = None
1850
1851 print("Based on stats: %s" % stats_arg)
1852 print(f'Expect summary: "{exp_line}"; with color "{exp_color}"')
1853 (line, color) = tr.build_summary_stats_line()
1854 print(f'Actually got: "{line}"; with color "{color}"')
1855 assert line == exp_line
1856 assert color == exp_color
1857
1858
1859def test_skip_counting_towards_summary(tr):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected