MCPcopy Index your code
hub / github.com/python/cpython / test_lineno_with_tracing

Method test_lineno_with_tracing

Lib/test/test_frame.py:146–164  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

144 self.assertFalse(endly)
145
146 def test_lineno_with_tracing(self):
147 def record_line():
148 f = sys._getframe(1)
149 lines.append(f.f_lineno-f.f_code.co_firstlineno)
150
151 def test(trace):
152 record_line()
153 if trace:
154 sys._getframe(0).f_trace = True
155 record_line()
156 record_line()
157
158 expected_lines = [1, 4, 5]
159 lines = []
160 test(False)
161 self.assertEqual(lines, expected_lines)
162 lines = []
163 test(True)
164 self.assertEqual(lines, expected_lines)
165
166 @support.cpython_only
167 def test_clear_refcycles(self):

Callers

nothing calls this directly

Calls 2

testFunction · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected