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

Method test_int_impure_region

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

Source from the content-addressed store, hash-verified

614 self.assertLessEqual(len(guard_nos_int_count), 1)
615
616 def test_int_impure_region(self):
617 def testfunc(loops):
618 num = 0
619 while num < loops:
620 x = num + num
621 y = 1
622 x // 2
623 a = x + y
624 num += 1
625 return a
626
627 res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
628 self.assertIsNotNone(ex)
629 binop_count = [opname for opname in iter_opnames(ex) if opname == "_BINARY_OP_ADD_INT"]
630 self.assertGreaterEqual(len(binop_count), 3)
631
632 def test_call_py_exact_args(self):
633 def testfunc(n):

Callers

nothing calls this directly

Calls 4

_run_with_optimizerMethod · 0.95
iter_opnamesFunction · 0.85
assertIsNotNoneMethod · 0.80
assertGreaterEqualMethod · 0.80

Tested by

no test coverage detected