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

Method test_trace_list_comprehension

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

Source from the content-addressed store, hash-verified

186 self.assertEqual(self.tracer.results().counts, expected)
187
188 def test_trace_list_comprehension(self):
189 self.tracer.runfunc(traced_caller_list_comprehension)
190
191 firstlineno_calling = get_firstlineno(traced_caller_list_comprehension)
192 firstlineno_called = get_firstlineno(traced_doubler)
193 expected = {
194 (self.my_py_filename, firstlineno_calling + 1): 1,
195 (self.my_py_filename, firstlineno_calling + 2): 11,
196 (self.my_py_filename, firstlineno_calling + 3): 1,
197 (self.my_py_filename, firstlineno_called + 1): 10,
198 }
199 self.assertEqual(self.tracer.results().counts, expected)
200
201 def test_traced_decorated_function(self):
202 self.tracer.runfunc(traced_decorated_function)

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