Skip to content

Commit 055b019

Browse files
committed
Fix test case
1 parent bdfd74f commit 055b019

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3953,12 +3953,13 @@ def testfunc(n):
39533953
def test_match_class(self):
39543954
def testfunc(n):
39553955
class A:
3956+
__match_args__ = ("val",)
39563957
val = 1
39573958
x = A()
39583959
ret = 0
39593960
for _ in range(n):
39603961
match x:
3961-
case A():
3962+
case A(1):
39623963
ret += x.val
39633964
return ret
39643965

@@ -3967,7 +3968,7 @@ class A:
39673968
uops = get_opnames(ex)
39683969

39693970
self.assertIn("_MATCH_CLASS", uops)
3970-
self.assertEqual(count_ops(ex, "_POP_TOP_NOP"), 4)
3971+
self.assertEqual(count_ops(ex, "_POP_TOP_NOP"), 5)
39713972

39723973
def test_143026(self):
39733974
# https://github.com/python/cpython/issues/143026

0 commit comments

Comments
 (0)