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

Method test_getsource

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

Source from the content-addressed store, hash-verified

174
175class TestTracebackEntry:
176 def test_getsource(self) -> None:
177 try:
178 if False:
179 pass # type: ignore[unreachable]
180 else:
181 assert False
182 except AssertionError:
183 exci = ExceptionInfo.from_current()
184 entry = exci.traceback[0]
185 source = entry.getsource()
186 assert source is not None
187 assert len(source) == 6
188 assert "assert False" in source[5]
189
190 def test_tb_entry_str(self):
191 try:

Callers

nothing calls this directly

Calls 2

from_currentMethod · 0.80
getsourceMethod · 0.80

Tested by

no test coverage detected