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

Method test_bad_getsource

testing/code/test_code.py:160–168  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

158
159class TestExceptionInfo:
160 def test_bad_getsource(self) -> None:
161 try:
162 if False:
163 pass # type: ignore[unreachable]
164 else:
165 assert False
166 except AssertionError:
167 exci = ExceptionInfo.from_current()
168 assert exci.getrepr()
169
170 def test_from_current_with_missing(self) -> None:
171 with pytest.raises(AssertionError, match="no current exception"):

Callers

nothing calls this directly

Calls 2

from_currentMethod · 0.80
getreprMethod · 0.80

Tested by

no test coverage detected