MCPcopy Index your code
hub / github.com/pytest-dev/pytest / test_code_highlight_simple

Method test_code_highlight_simple

testing/test_terminal.py:2788–2804  ·  view source on GitHub ↗
(self, pytester: Pytester, color_mapping)

Source from the content-addressed store, hash-verified

2786
2787class TestCodeHighlight:
2788 def test_code_highlight_simple(self, pytester: Pytester, color_mapping) -> None:
2789 pytester.makepyfile(
2790 """
2791 def test_foo():
2792 assert 1 == 10
2793 """
2794 )
2795 result = pytester.runpytest("--color=yes")
2796 result.stdout.fnmatch_lines(
2797 color_mapping.format_for_fnmatch(
2798 [
2799 " {reset}{kw}def{hl-reset}{kwspace}{function}test_foo{hl-reset}():{endline}",
2800 "> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}{endline}",
2801 "{bold}{red}E assert 1 == 10{reset}",
2802 ]
2803 )
2804 )
2805
2806 def test_code_highlight_continuation(
2807 self, pytester: Pytester, color_mapping

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
format_for_fnmatchMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected