(self)
| 2379 | self.assertLessEqual(count_ops(ex, "_POP_TOP"), 2) |
| 2380 | |
| 2381 | def test_contains_op_set(self): |
| 2382 | def testfunc(n): |
| 2383 | x = 0 |
| 2384 | s = {1, 2, 3} |
| 2385 | for _ in range(n): |
| 2386 | if 2 in s: |
| 2387 | x += 1 |
| 2388 | return x |
| 2389 | |
| 2390 | res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD) |
| 2391 | self.assertEqual(res, TIER2_THRESHOLD) |
| 2392 | self.assertIsNotNone(ex) |
| 2393 | uops = get_opnames(ex) |
| 2394 | self.assertIn("_CONTAINS_OP_SET", uops) |
| 2395 | self.assertIn("_POP_TOP_NOP", uops) |
| 2396 | self.assertLessEqual(count_ops(ex, "_POP_TOP"), 2) |
| 2397 | |
| 2398 | def test_contains_op_dict(self): |
| 2399 | def testfunc(n): |
nothing calls this directly
no test coverage detected