Skip to content

Commit f6415fc

Browse files
committed
Add failing test markers
1 parent 9fd9051 commit f6415fc

File tree

1 file changed

+48
-8
lines changed

1 file changed

+48
-8
lines changed

Lib/test/test_patma.py

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def check_mapping_then_sequence(x):
4242
case [*_]:
4343
return "seq"
4444

45+
@unittest.expectedFailure # TODO: RUSTPYTHON
4546
def test_multiple_inheritance_mapping(self):
4647
class C:
4748
pass
@@ -62,6 +63,7 @@ class M4(dict, collections.abc.Sequence, C):
6263
self.assertEqual(self.check_mapping_then_sequence(M3()), "map")
6364
self.assertEqual(self.check_mapping_then_sequence(M4()), "map")
6465

66+
@unittest.expectedFailure # TODO: RUSTPYTHON
6567
def test_multiple_inheritance_sequence(self):
6668
class C:
6769
pass
@@ -82,6 +84,7 @@ class S4(collections.UserList, dict, C):
8284
self.assertEqual(self.check_mapping_then_sequence(S3()), "seq")
8385
self.assertEqual(self.check_mapping_then_sequence(S4()), "seq")
8486

87+
@unittest.expectedFailure # TODO: RUSTPYTHON
8588
def test_late_registration_mapping(self):
8689
class Parent:
8790
pass
@@ -105,6 +108,7 @@ class GrandchildPost(ChildPost):
105108
self.assertEqual(self.check_mapping_then_sequence(ChildPost()), "map")
106109
self.assertEqual(self.check_mapping_then_sequence(GrandchildPost()), "map")
107110

111+
@unittest.expectedFailure # TODO: RUSTPYTHON
108112
def test_late_registration_sequence(self):
109113
class Parent:
110114
pass
@@ -582,6 +586,7 @@ def test_patma_051(self):
582586
self.assertEqual(y, 1)
583587
self.assertEqual(z, 0)
584588

589+
@unittest.expectedFailure # TODO: RUSTPYTHON
585590
def test_patma_052(self):
586591
x = [1, 0]
587592
match x:
@@ -1335,6 +1340,7 @@ def test_patma_132(self):
13351340
self.assertEqual(x, [0, 1, 2])
13361341
self.assertEqual(y, 0)
13371342

1343+
@unittest.expectedFailure # TODO: RUSTPYTHON
13381344
def test_patma_133(self):
13391345
x = collections.defaultdict(int, {0: 1})
13401346
match x:
@@ -1347,6 +1353,7 @@ def test_patma_133(self):
13471353
self.assertEqual(x, {0: 1})
13481354
self.assertEqual(y, 2)
13491355

1356+
@unittest.expectedFailure # TODO: RUSTPYTHON
13501357
def test_patma_134(self):
13511358
x = collections.defaultdict(int, {0: 1})
13521359
match x:
@@ -1360,6 +1367,7 @@ def test_patma_134(self):
13601367
self.assertEqual(y, 2)
13611368
self.assertEqual(z, {0: 1})
13621369

1370+
@unittest.expectedFailure # TODO: RUSTPYTHON
13631371
def test_patma_135(self):
13641372
x = collections.defaultdict(int, {0: 1})
13651373
match x:
@@ -1896,6 +1904,7 @@ def whereis(points):
18961904
self.assertEqual(whereis([Point(0, 0), Point(0, 0), Point(0, 0)]), "Something else")
18971905
self.assertEqual(whereis([Point(0, 1), Point(0, 1), Point(0, 1)]), "Something else")
18981906

1907+
@unittest.expectedFailure # TODO: RUSTPYTHON
18991908
def test_patma_183(self):
19001909
def whereis(point):
19011910
match point:
@@ -2244,6 +2253,7 @@ def f(w):
22442253
self.assertEqual(f(None), {})
22452254
self.assertEqual(f((1, 2)), {})
22462255

2256+
@unittest.expectedFailure # TODO: RUSTPYTHON
22472257
def test_patma_210(self):
22482258
def f(w):
22492259
match w:
@@ -2563,14 +2573,15 @@ def test_patma_240(self):
25632573
self.assertEqual(y, 0)
25642574
self.assertEqual(z, {0: 1})
25652575

2566-
def test_patma_241(self):
2567-
x = [[{0: 0}]]
2568-
match x:
2569-
case list([({-0-0j: int(real=0+0j, imag=0-0j) | (1) as z},)]):
2570-
y = 0
2571-
self.assertEqual(x, [[{0: 0}]])
2572-
self.assertEqual(y, 0)
2573-
self.assertEqual(z, 0)
2576+
# TODO: RUSTPYTHON
2577+
# def test_patma_241(self):
2578+
# x = [[{0: 0}]]
2579+
# match x:
2580+
# case list([({-0-0j: int(real=0+0j, imag=0-0j) | (1) as z},)]):
2581+
# y = 0
2582+
# self.assertEqual(x, [[{0: 0}]])
2583+
# self.assertEqual(y, 0)
2584+
# self.assertEqual(z, 0)
25742585

25752586
def test_patma_242(self):
25762587
x = range(3)
@@ -2684,6 +2695,7 @@ def f(self, x):
26842695
setattr(c, "__attr", "spam") # setattr is needed because we're in a class scope
26852696
self.assertEqual(Outer().f(c), "spam")
26862697

2698+
@unittest.expectedFailure # TODO: RUSTPYTHON
26872699
def test_patma_250(self):
26882700
def f(x):
26892701
match x:
@@ -2695,6 +2707,7 @@ def f(x):
26952707
self.assertIs(f({"foo": 1}), True)
26962708
self.assertIs(f({"foo": -1}), False)
26972709

2710+
@unittest.expectedFailure # TODO: RUSTPYTHON
26982711
def test_patma_251(self):
26992712
def f(v, x):
27002713
match v:
@@ -2713,6 +2726,7 @@ def __init__(self, attr):
27132726
self.assertIs(f(-1, X(-1)), False)
27142727
self.assertIs(f(1, X(-1)), None)
27152728

2729+
@unittest.expectedFailure # TODO: RUSTPYTHON
27162730
def test_patma_252(self):
27172731
# Side effects must be possible in guards:
27182732
effects = []
@@ -2750,6 +2764,7 @@ def f(v):
27502764
self.assertEqual(f(1), 1)
27512765
self.assertEqual(f({"x": 1}), 1)
27522766

2767+
@unittest.expectedFailure # TODO: RUSTPYTHON
27532768
def test_patma_255(self):
27542769
x = []
27552770
match x:
@@ -2944,13 +2959,15 @@ def test_invalid_syntax_1(self):
29442959
pass
29452960
""")
29462961

2962+
@unittest.expectedFailure # TODO: RUSTPYTHON
29472963
def test_invalid_syntax_2(self):
29482964
self.assert_syntax_error("""
29492965
match ...:
29502966
case {**_}:
29512967
pass
29522968
""")
29532969

2970+
@unittest.expectedFailure # TODO: RUSTPYTHON
29542971
def test_invalid_syntax_3(self):
29552972
self.assert_syntax_error("""
29562973
match ...:
@@ -3070,13 +3087,15 @@ def test_name_capture_makes_remaining_patterns_unreachable_4(self):
30703087
pass
30713088
""")
30723089

3090+
@unittest.expectedFailure # TODO: RUSTPYTHON
30733091
def test_patterns_may_only_match_literals_and_attribute_lookups_0(self):
30743092
self.assert_syntax_error("""
30753093
match ...:
30763094
case f"":
30773095
pass
30783096
""")
30793097

3098+
@unittest.expectedFailure # TODO: RUSTPYTHON
30803099
def test_patterns_may_only_match_literals_and_attribute_lookups_1(self):
30813100
self.assert_syntax_error("""
30823101
match ...:
@@ -3119,6 +3138,7 @@ def test_real_number_multiple_ops(self):
31193138
pass
31203139
""")
31213140

3141+
@unittest.expectedFailure # TODO: RUSTPYTHON
31223142
def test_real_number_wrong_ops(self):
31233143
for op in ["*", "/", "@", "**", "%", "//"]:
31243144
with self.subTest(op=op):
@@ -3187,20 +3207,23 @@ def test_wildcard_makes_remaining_patterns_unreachable_5(self):
31873207
pass
31883208
""")
31893209

3210+
@unittest.expectedFailure # TODO: RUSTPYTHON
31903211
def test_mapping_pattern_duplicate_key(self):
31913212
self.assert_syntax_error("""
31923213
match ...:
31933214
case {"a": _, "a": _}:
31943215
pass
31953216
""")
31963217

3218+
@unittest.expectedFailure # TODO: RUSTPYTHON
31973219
def test_mapping_pattern_duplicate_key_edge_case0(self):
31983220
self.assert_syntax_error("""
31993221
match ...:
32003222
case {0: _, False: _}:
32013223
pass
32023224
""")
32033225

3226+
@unittest.expectedFailure # TODO: RUSTPYTHON
32043227
def test_mapping_pattern_duplicate_key_edge_case1(self):
32053228
self.assert_syntax_error("""
32063229
match ...:
@@ -3215,6 +3238,8 @@ def test_mapping_pattern_duplicate_key_edge_case2(self):
32153238
pass
32163239
""")
32173240

3241+
3242+
@unittest.expectedFailure # TODO: RUSTPYTHON
32183243
def test_mapping_pattern_duplicate_key_edge_case3(self):
32193244
self.assert_syntax_error("""
32203245
match ...:
@@ -3224,6 +3249,7 @@ def test_mapping_pattern_duplicate_key_edge_case3(self):
32243249

32253250
class TestTypeErrors(unittest.TestCase):
32263251

3252+
@unittest.expectedFailure # TODO: RUSTPYTHON
32273253
def test_accepts_positional_subpatterns_0(self):
32283254
class Class:
32293255
__match_args__ = ()
@@ -3236,6 +3262,7 @@ class Class:
32363262
self.assertIs(y, None)
32373263
self.assertIs(z, None)
32383264

3265+
@unittest.expectedFailure # TODO: RUSTPYTHON
32393266
def test_accepts_positional_subpatterns_1(self):
32403267
x = range(10)
32413268
y = None
@@ -3246,6 +3273,7 @@ def test_accepts_positional_subpatterns_1(self):
32463273
self.assertEqual(x, range(10))
32473274
self.assertIs(y, None)
32483275

3276+
@unittest.expectedFailure # TODO: RUSTPYTHON
32493277
def test_got_multiple_subpatterns_for_attribute_0(self):
32503278
class Class:
32513279
__match_args__ = ("a", "a")
@@ -3260,6 +3288,7 @@ class Class:
32603288
self.assertIs(y, None)
32613289
self.assertIs(z, None)
32623290

3291+
@unittest.expectedFailure # TODO: RUSTPYTHON
32633292
def test_got_multiple_subpatterns_for_attribute_1(self):
32643293
class Class:
32653294
__match_args__ = ("a",)
@@ -3286,6 +3315,7 @@ class Class:
32863315
self.assertIs(y, None)
32873316
self.assertIs(z, None)
32883317

3318+
@unittest.expectedFailure # TODO: RUSTPYTHON
32893319
def test_match_args_must_be_a_tuple_0(self):
32903320
class Class:
32913321
__match_args__ = None
@@ -3298,6 +3328,7 @@ class Class:
32983328
self.assertIs(y, None)
32993329
self.assertIs(z, None)
33003330

3331+
@unittest.expectedFailure # TODO: RUSTPYTHON
33013332
def test_match_args_must_be_a_tuple_1(self):
33023333
class Class:
33033334
__match_args__ = "XYZ"
@@ -3310,6 +3341,7 @@ class Class:
33103341
self.assertIs(y, None)
33113342
self.assertIs(z, None)
33123343

3344+
@unittest.expectedFailure # TODO: RUSTPYTHON
33133345
def test_match_args_must_be_a_tuple_2(self):
33143346
class Class:
33153347
__match_args__ = ["spam", "eggs"]
@@ -3365,6 +3397,7 @@ class A:
33653397

33663398
class TestValueErrors(unittest.TestCase):
33673399

3400+
@unittest.expectedFailure # TODO: RUSTPYTHON
33683401
def test_mapping_pattern_checks_duplicate_key_1(self):
33693402
class Keys:
33703403
KEY = "a"
@@ -3379,6 +3412,7 @@ class Keys:
33793412
self.assertIs(z, None)
33803413

33813414
class TestSourceLocations(unittest.TestCase):
3415+
@unittest.expectedFailure # TODO: RUSTPYTHON
33823416
def test_jump_threading(self):
33833417
# See gh-123048
33843418
def f():
@@ -3418,6 +3452,7 @@ def trace(frame, event, arg):
34183452
sys.settrace(old_trace)
34193453
return actual_linenos
34203454

3455+
@unittest.expectedFailure # TODO: RUSTPYTHON
34213456
def test_default_wildcard(self):
34223457
def f(command): # 0
34233458
match command.split(): # 1
@@ -3432,6 +3467,7 @@ def f(command): # 0
34323467
self.assertListEqual(self._trace(f, "go x"), [1, 2, 4, 5])
34333468
self.assertListEqual(self._trace(f, "spam"), [1, 2, 4, 6, 7])
34343469

3470+
@unittest.expectedFailure # TODO: RUSTPYTHON
34353471
def test_default_capture(self):
34363472
def f(command): # 0
34373473
match command.split(): # 1
@@ -3446,6 +3482,7 @@ def f(command): # 0
34463482
self.assertListEqual(self._trace(f, "go x"), [1, 2, 4, 5])
34473483
self.assertListEqual(self._trace(f, "spam"), [1, 2, 4, 6, 7])
34483484

3485+
@unittest.expectedFailure # TODO: RUSTPYTHON
34493486
def test_no_default(self):
34503487
def f(command): # 0
34513488
match command.split(): # 1
@@ -3458,6 +3495,7 @@ def f(command): # 0
34583495
self.assertListEqual(self._trace(f, "go x"), [1, 2, 4, 5])
34593496
self.assertListEqual(self._trace(f, "spam"), [1, 2, 4])
34603497

3498+
@unittest.expectedFailure # TODO: RUSTPYTHON
34613499
def test_only_default_wildcard(self):
34623500
def f(command): # 0
34633501
match command.split(): # 1
@@ -3468,6 +3506,7 @@ def f(command): # 0
34683506
self.assertListEqual(self._trace(f, "go x"), [1, 2, 3])
34693507
self.assertListEqual(self._trace(f, "spam"), [1, 2, 3])
34703508

3509+
@unittest.expectedFailure # TODO: RUSTPYTHON
34713510
def test_only_default_capture(self):
34723511
def f(command): # 0
34733512
match command.split(): # 1
@@ -3478,6 +3517,7 @@ def f(command): # 0
34783517
self.assertListEqual(self._trace(f, "go x"), [1, 2, 3])
34793518
self.assertListEqual(self._trace(f, "spam"), [1, 2, 3])
34803519

3520+
@unittest.expectedFailure # TODO: RUSTPYTHON
34813521
def test_unreachable_code(self):
34823522
def f(command): # 0
34833523
match command: # 1

0 commit comments

Comments
 (0)