]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-115727: Temporary fix of confidence score test. (GH-115728)
authorMark Shannon <mark@hotpy.org>
Tue, 20 Feb 2024 18:50:31 +0000 (18:50 +0000)
committerGitHub <noreply@github.com>
Tue, 20 Feb 2024 18:50:31 +0000 (18:50 +0000)
Temporary fix of confidence score test.

Lib/test/test_capi/test_opt.py

index 3ba38c77710b2b35898e5b2428a327be888478f0..d53d6a057aa872fa6fe281ea8e02bf48ba8c3abc 100644 (file)
@@ -554,10 +554,9 @@ class TestUops(unittest.TestCase):
         ex = get_first_executor(testfunc)
         self.assertIsNotNone(ex)
         ops = [opname for opname, _, _ in ex]
-        count = ops.count("_GUARD_IS_TRUE_POP")
-        # Because Each 'if' halves the score, the second branch is
-        # too much already.
-        self.assertEqual(count, 1)
+        #Since branch is 50/50 the trace could go either way.
+        count = ops.count("_GUARD_IS_TRUE_POP") + ops.count("_GUARD_IS_FALSE_POP")
+        self.assertLessEqual(count, 2)
 
 class TestUopsOptimization(unittest.TestCase):