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

Function check

testing/test_terminal.py:2580–2600  ·  view source on GitHub ↗
(msg, width, expected)

Source from the content-addressed store, hash-verified

2578 pass
2579
2580 def check(msg, width, expected):
2581 class DummyTerminalWriter:
2582 fullwidth = width
2583
2584 def markup(self, word: str, **markup: str):
2585 return word
2586
2587 __tracebackhide__ = True
2588 if msg:
2589 rep.longrepr.reprcrash.message = msg # type: ignore
2590 actual = _get_line_with_reprcrash_message(
2591 config(), # type: ignore[arg-type]
2592 rep(), # type: ignore[arg-type]
2593 DummyTerminalWriter(), # type: ignore[arg-type]
2594 {},
2595 )
2596
2597 assert actual == expected
2598 if actual != f"{mocked_verbose_word} {mocked_pos}":
2599 assert len(actual) <= width
2600 assert wcswidth(actual) <= width
2601
2602 # AttributeError with message
2603 check(None, 80, "FAILED some::nodeid")

Callers 2

test_line_with_reprcrashFunction · 0.70
test_select_simpleMethod · 0.70

Calls 5

wcswidthFunction · 0.90
configClass · 0.85
DummyTerminalWriterClass · 0.85
repClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…