MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_loop_caller_importing

Method test_loop_caller_importing

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

Source from the content-addressed store, hash-verified

345 @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
346 'pre-existing trace function throws off measurements')
347 def test_loop_caller_importing(self):
348 self.tracer.runfunc(traced_func_importing_caller, 1)
349
350 expected = {
351 ((os.path.splitext(trace.__file__)[0] + '.py', 'trace', 'Trace.runfunc'),
352 (self.filemod + ('traced_func_importing_caller',))): 1,
353 ((self.filemod + ('traced_func_simple_caller',)),
354 (self.filemod + ('traced_func_linear',))): 1,
355 ((self.filemod + ('traced_func_importing_caller',)),
356 (self.filemod + ('traced_func_simple_caller',))): 1,
357 ((self.filemod + ('traced_func_importing_caller',)),
358 (self.filemod + ('traced_func_importing',))): 1,
359 ((self.filemod + ('traced_func_importing',)),
360 (fix_ext_py(testmod.__file__), 'testmod', 'func')): 1,
361 }
362 self.assertEqual(self.tracer.results().callers, expected)
363
364
365# 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