Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Nov 7, 2024
1 parent b1d77eb commit 3517502
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/test/test_capi/test_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,9 @@ def test_guard_type_version_not_removed(self):

def thing(a):
x = 0
for i in range(100):
# 90 iterations with Foo.attr == 1, then 16 to invalidate, warm up
# again, and re-optimize with Foo.attr == 2:
for i in range(90 + 16):
x += a.attr
# for the first 90 iterations we set the attribute on this dummy function which shouldn't
# trigger the type watcher
Expand All @@ -1410,7 +1412,7 @@ class Bar:
opnames = list(iter_opnames(ex))

self.assertIsNotNone(ex)
self.assertEqual(res, 219)
self.assertEqual(res, 243)
guard_type_version_count = opnames.count("_GUARD_TYPE_VERSION")
self.assertEqual(guard_type_version_count, 2)

Expand Down

0 comments on commit 3517502

Please sign in to comment.