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

Method test_code_highlight_simple

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

Source from the content-addressed store, hash-verified

2367
2368class TestCodeHighlight:
2369 def test_code_highlight_simple(self, pytester: Pytester, color_mapping) -> None:
2370 pytester.makepyfile(
2371 """
2372 def test_foo():
2373 assert 1 == 10
2374 """
2375 )
2376 result = pytester.runpytest("--color=yes")
2377 result.stdout.fnmatch_lines(
2378 color_mapping.format_for_fnmatch(
2379 [
2380 " {kw}def{hl-reset} {function}test_foo{hl-reset}():",
2381 "> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}",
2382 "{bold}{red}E assert 1 == 10{reset}",
2383 ]
2384 )
2385 )
2386
2387 def test_code_highlight_continuation(
2388 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