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

Function test_excinfo_exconly

testing/code/test_excinfo.py:343–351  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341
342
343def test_excinfo_exconly():
344 with pytest.raises(ValueError) as excinfo:
345 h()
346 assert excinfo.exconly().startswith("ValueError")
347 with pytest.raises(ValueError) as excinfo:
348 raise ValueError("hello\nworld")
349 msg = excinfo.exconly(tryshort=True)
350 assert msg.startswith("ValueError")
351 assert msg.endswith("world")
352
353
354def test_excinfo_repr_str() -> None:

Callers

nothing calls this directly

Calls 3

exconlyMethod · 0.80
endswithMethod · 0.80
hFunction · 0.70

Tested by

no test coverage detected