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

Method test_getsource

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

Source from the content-addressed store, hash-verified

159
160class TestTracebackEntry:
161 def test_getsource(self) -> None:
162 try:
163 if False:
164 pass
165 else:
166 assert False
167 except AssertionError:
168 exci = ExceptionInfo.from_current()
169 entry = exci.traceback[0]
170 source = entry.getsource()
171 assert source is not None
172 assert len(source) == 6
173 assert "assert False" in source[5]
174
175 def test_tb_entry_str(self):
176 try:

Callers

nothing calls this directly

Calls 2

from_currentMethod · 0.80
getsourceMethod · 0.80

Tested by

no test coverage detected