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

Method test_trace_func_generator

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

Source from the content-addressed store, hash-verified

171 @unittest.skipIf(os.environ.get('PYTHON_UOPS_OPTIMIZE') == '0',
172 "Line counts differ when JIT optimizer is disabled")
173 def test_trace_func_generator(self):
174 self.tracer.runfunc(traced_func_calling_generator)
175
176 firstlineno_calling = get_firstlineno(traced_func_calling_generator)
177 firstlineno_gen = get_firstlineno(traced_func_generator)
178 expected = {
179 (self.my_py_filename, firstlineno_calling + 1): 1,
180 (self.my_py_filename, firstlineno_calling + 2): 11,
181 (self.my_py_filename, firstlineno_calling + 3): 10,
182 (self.my_py_filename, firstlineno_gen + 1): 1,
183 (self.my_py_filename, firstlineno_gen + 2): 11,
184 (self.my_py_filename, firstlineno_gen + 3): 10,
185 }
186 self.assertEqual(self.tracer.results().counts, expected)
187
188 def test_trace_list_comprehension(self):
189 self.tracer.runfunc(traced_caller_list_comprehension)

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