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

Method test_traced_func_linear

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

Source from the content-addressed store, hash-verified

131 self.my_py_filename = fix_ext_py(__file__)
132
133 def test_traced_func_linear(self):
134 result = self.tracer.runfunc(traced_func_linear, 2, 5)
135 self.assertEqual(result, 7)
136
137 # all lines are executed once
138 expected = {}
139 firstlineno = get_firstlineno(traced_func_linear)
140 for i in range(1, 5):
141 expected[(self.my_py_filename, firstlineno + i)] = 1
142
143 self.assertEqual(self.tracer.results().counts, expected)
144
145 @unittest.skipIf(os.environ.get('PYTHON_UOPS_OPTIMIZE') == '0',
146 "Line counts differ when JIT optimizer is disabled")

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