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

Method test_inst_method_calling

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

Source from the content-addressed store, hash-verified

308 @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
309 'pre-existing trace function throws off measurements')
310 def test_inst_method_calling(self):
311 obj = TracedClass(20)
312 self.tracer.runfunc(obj.inst_method_calling, 1)
313
314 expected = {
315 self.filemod + ('TracedClass.inst_method_calling',): 1,
316 self.filemod + ('TracedClass.inst_method_linear',): 1,
317 self.filemod + ('traced_func_linear',): 1,
318 }
319 self.assertEqual(self.tracer.results().calledfuncs, expected)
320
321 def test_traced_decorated_function(self):
322 self.tracer.runfunc(traced_decorated_function)

Callers

nothing calls this directly

Calls 4

TracedClassClass · 0.85
runfuncMethod · 0.80
resultsMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected