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

Method test_traced_decorated_function

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

Source from the content-addressed store, hash-verified

199 self.assertEqual(self.tracer.results().counts, expected)
200
201 def test_traced_decorated_function(self):
202 self.tracer.runfunc(traced_decorated_function)
203
204 firstlineno = get_firstlineno(traced_decorated_function)
205 expected = {
206 (self.my_py_filename, firstlineno + 1): 1,
207 (self.my_py_filename, firstlineno + 2): 1,
208 (self.my_py_filename, firstlineno + 3): 1,
209 (self.my_py_filename, firstlineno + 4): 1,
210 (self.my_py_filename, firstlineno + 5): 1,
211 (self.my_py_filename, firstlineno + 6): 1,
212 (self.my_py_filename, firstlineno + 7): 2,
213 (self.my_py_filename, firstlineno + 8): 2,
214 (self.my_py_filename, firstlineno + 9): 2,
215 (self.my_py_filename, firstlineno + 10): 1,
216 (self.my_py_filename, firstlineno + 11): 1,
217 }
218 self.assertEqual(self.tracer.results().counts, expected)
219
220 def test_linear_methods(self):
221 # XXX todo: later add 'static_method_linear' and 'class_method_linear'

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