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

Function test_repr_traceback_with_unicode

testing/code/test_excinfo.py:1369–1380  ·  view source on GitHub ↗
(style, encoding)

Source from the content-addressed store, hash-verified

1367@pytest.mark.parametrize("style", ["short", "long"])
1368@pytest.mark.parametrize("encoding", [None, "utf8", "utf16"])
1369def test_repr_traceback_with_unicode(style, encoding):
1370 if encoding is None:
1371 msg: Union[str, bytes] = "☹"
1372 else:
1373 msg = "☹".encode(encoding)
1374 try:
1375 raise RuntimeError(msg)
1376 except RuntimeError:
1377 e_info = ExceptionInfo.from_current()
1378 formatter = FormattedExcinfo(style=style)
1379 repr_traceback = formatter.repr_traceback(e_info)
1380 assert repr_traceback is not None
1381
1382
1383def test_cwd_deleted(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

repr_tracebackMethod · 0.95
FormattedExcinfoClass · 0.90
from_currentMethod · 0.80

Tested by

no test coverage detected