Fix test to reflect real-world usage
def testfunc(n):
x = 0
for _ in range(n):
- my_abs = abs
- y = my_abs(1)
+ y = abs(1)
x += y
return x
self.assertEqual(res, TIER2_THRESHOLD)
self.assertIsNotNone(ex)
uops = get_opnames(ex)
+ pop_tops = [opname for opname in iter_opnames(ex) if opname == "_POP_TOP"]
self.assertIn("_CALL_BUILTIN_O", uops)
- self.assertNotIn("_POP_TOP", uops)
self.assertIn("_POP_TOP_NOP", uops)
+ self.assertLessEqual(len(pop_tops), 1)
def test_call_method_descriptor_o(self):
def testfunc(n):