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

Method test_resume

Lib/test/test_capi/test_opt.py:337–352  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

335 self.assertIn("_JUMP_TO_TOP", uops)
336
337 def test_resume(self):
338 def testfunc(x):
339 if x <= 1:
340 return 1
341 return testfunc(x-1)
342
343 for _ in range((TIER2_RESUME_THRESHOLD + 99)//100):
344 testfunc(101)
345
346 ex = get_first_executor(testfunc)
347 self.assertIsNotNone(ex)
348 uops = get_opnames(ex)
349 # 0. _START_EXECUTOR
350 # 1. _MAKE_WARM
351 # 2. _TIER2_RESUME_CHECK
352 self.assertEqual(uops[2], "_TIER2_RESUME_CHECK")
353
354 def test_jump_forward(self):
355 def testfunc(n):

Callers

nothing calls this directly

Calls 5

testfuncFunction · 0.85
get_first_executorFunction · 0.85
get_opnamesFunction · 0.85
assertIsNotNoneMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected