(self)
| 2396 | self.assertLessEqual(count_ops(ex, "_POP_TOP"), 2) |
| 2397 | |
| 2398 | def test_contains_op_dict(self): |
| 2399 | def testfunc(n): |
| 2400 | x = 0 |
| 2401 | d = {'a': 1, 'b': 2} |
| 2402 | for _ in range(n): |
| 2403 | if 'a' in d: |
| 2404 | x += 1 |
| 2405 | return x |
| 2406 | |
| 2407 | res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD) |
| 2408 | self.assertEqual(res, TIER2_THRESHOLD) |
| 2409 | self.assertIsNotNone(ex) |
| 2410 | uops = get_opnames(ex) |
| 2411 | self.assertIn("_CONTAINS_OP_DICT", uops) |
| 2412 | self.assertIn("_POP_TOP_NOP", uops) |
| 2413 | self.assertLessEqual(count_ops(ex, "_POP_TOP"), 2) |
| 2414 | |
| 2415 | def test_call_type_1_guards_removed(self): |
| 2416 | def testfunc(n): |
nothing calls this directly
no test coverage detected