]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a test
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Sun, 26 Oct 2025 01:00:17 +0000 (01:00 +0000)
committerKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Sun, 26 Oct 2025 01:00:17 +0000 (01:00 +0000)
Lib/test/test_capi/test_opt.py

index 9adbe75b205945228e9605fda7d1cab115e75653..b702da5320449ee86e3070c3371668efc7c859a7 100644 (file)
@@ -1241,14 +1241,8 @@ class TestUopsOptimization(unittest.TestCase):
             pass
 
         res, ex = self._run_with_optimizer(thing, Foo())
-        opnames = list(iter_opnames(ex))
-        self.assertIsNotNone(ex)
-        self.assertEqual(res, TIER2_THRESHOLD * 6 + 1)
-        call = opnames.index("_CALL_BUILTIN_FAST")
-        load_attr_top = opnames.index("_POP_TOP_LOAD_CONST_INLINE_BORROW", 0, call)
-        load_attr_bottom = opnames.index("_POP_TOP_LOAD_CONST_INLINE_BORROW", call)
-        self.assertEqual(opnames[:load_attr_top].count("_GUARD_TYPE_VERSION"), 1)
-        self.assertEqual(opnames[call:load_attr_bottom].count("_CHECK_VALIDITY"), 2)
+        # Cleaned up by the invalidation.
+        self.assertIsNone(ex)
 
     def test_guard_type_version_removed_escaping(self):