(msg, width, expected)
| 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") |
no test coverage detected
searching dependent graphs…