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

Method test_loop_caller_importing

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

Source from the content-addressed store, hash-verified

341 @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
342 'pre-existing trace function throws off measurements')
343 def test_loop_caller_importing(self):
344 self.tracer.runfunc(traced_func_importing_caller, 1)
345
346 expected = {
347 ((os.path.splitext(trace.__file__)[0] + '.py', 'trace', 'Trace.runfunc'),
348 (self.filemod + ('traced_func_importing_caller',))): 1,
349 ((self.filemod + ('traced_func_simple_caller',)),
350 (self.filemod + ('traced_func_linear',))): 1,
351 ((self.filemod + ('traced_func_importing_caller',)),
352 (self.filemod + ('traced_func_simple_caller',))): 1,
353 ((self.filemod + ('traced_func_importing_caller',)),
354 (self.filemod + ('traced_func_importing',))): 1,
355 ((self.filemod + ('traced_func_importing',)),
356 (fix_ext_py(testmod.__file__), 'testmod', 'func')): 1,
357 }
358 self.assertEqual(self.tracer.results().callers, expected)
359
360
361# Created separately for issue #3821

Callers

nothing calls this directly

Calls 5

fix_ext_pyFunction · 0.85
runfuncMethod · 0.80
splitextMethod · 0.80
resultsMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected