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

Method test_traced_func_loop

Lib/test/test_trace.py:147–157  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

145 @unittest.skipIf(os.environ.get('PYTHON_UOPS_OPTIMIZE') == '0',
146 "Line counts differ when JIT optimizer is disabled")
147 def test_traced_func_loop(self):
148 self.tracer.runfunc(traced_func_loop, 2, 3)
149
150 firstlineno = get_firstlineno(traced_func_loop)
151 expected = {
152 (self.my_py_filename, firstlineno + 1): 1,
153 (self.my_py_filename, firstlineno + 2): 6,
154 (self.my_py_filename, firstlineno + 3): 5,
155 (self.my_py_filename, firstlineno + 4): 1,
156 }
157 self.assertEqual(self.tracer.results().counts, expected)
158
159 def test_traced_func_importing(self):
160 self.tracer.runfunc(traced_func_importing, 2, 5)

Callers

nothing calls this directly

Calls 4

get_firstlinenoFunction · 0.85
runfuncMethod · 0.80
resultsMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected