Skip to content

Commit 4973c1b

Browse files
authored
Merge branch 'RustPython:main' into main
2 parents abf4817 + b80c2bd commit 4973c1b

29 files changed

Lines changed: 5706 additions & 1390 deletions

Lib/test/test_compile.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,6 @@ def unused_block_while_else():
10841084
self.assertEqual('RETURN_VALUE', opcodes[-1].opname)
10851085
self.assertEqual(None, opcodes[-1].argval)
10861086

1087-
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: 3 != 8
10881087
def test_false_while_loop(self):
10891088
def break_in_while():
10901089
while False:
@@ -1103,7 +1102,6 @@ def continue_in_while():
11031102
self.assertEqual('RETURN_VALUE', opcodes[-1].opname)
11041103
self.assertEqual(None, opcodes[1].argval)
11051104

1106-
@unittest.expectedFailure # TODO: RUSTPYTHON
11071105
def test_consts_in_conditionals(self):
11081106
def and_true(x):
11091107
return True and x
@@ -2578,15 +2576,13 @@ def test_if_else(self):
25782576
def test_binop(self):
25792577
self.check_stack_size("x + " * self.N + "x")
25802578

2581-
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: 101 not less than or equal to 6
25822579
def test_list(self):
25832580
self.check_stack_size("[" + "x, " * self.N + "x]")
25842581

25852582
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: 101 not less than or equal to 6
25862583
def test_tuple(self):
25872584
self.check_stack_size("(" + "x, " * self.N + "x)")
25882585

2589-
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: 101 not less than or equal to 6
25902586
def test_set(self):
25912587
self.check_stack_size("{" + "x, " * self.N + "x}")
25922588

Lib/test/test_grammar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ def test_var_annot_syntax_errors(self):
304304
" nonlocal x\n"
305305
" x: int\n")
306306

307-
@unittest.expectedFailure # TODO: RUSTPYTHON
308307
def test_var_annot_basic_semantics(self):
309308
# execution order
310309
with self.assertRaises(ZeroDivisionError):

Lib/test/test_patma.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3448,7 +3448,6 @@ def f(command): # 0
34483448
self.assertListEqual(self._trace(f, "go x"), [1, 2, 4, 5])
34493449
self.assertListEqual(self._trace(f, "spam"), [1, 2, 4, 6, 7])
34503450

3451-
@unittest.expectedFailure # TODO: RUSTPYTHON
34523451
def test_default_capture(self):
34533452
def f(command): # 0
34543453
match command.split(): # 1
@@ -3463,7 +3462,6 @@ def f(command): # 0
34633462
self.assertListEqual(self._trace(f, "go x"), [1, 2, 4, 5])
34643463
self.assertListEqual(self._trace(f, "spam"), [1, 2, 4, 6, 7])
34653464

3466-
@unittest.expectedFailure # TODO: RUSTPYTHON
34673465
def test_no_default(self):
34683466
def f(command): # 0
34693467
match command.split(): # 1
@@ -3476,7 +3474,6 @@ def f(command): # 0
34763474
self.assertListEqual(self._trace(f, "go x"), [1, 2, 4, 5])
34773475
self.assertListEqual(self._trace(f, "spam"), [1, 2, 4])
34783476

3479-
@unittest.expectedFailure # TODO: RUSTPYTHON
34803477
def test_only_default_wildcard(self):
34813478
def f(command): # 0
34823479
match command.split(): # 1
@@ -3487,7 +3484,6 @@ def f(command): # 0
34873484
self.assertListEqual(self._trace(f, "go x"), [1, 2, 3])
34883485
self.assertListEqual(self._trace(f, "spam"), [1, 2, 3])
34893486

3490-
@unittest.expectedFailure # TODO: RUSTPYTHON
34913487
def test_only_default_capture(self):
34923488
def f(command): # 0
34933489
match command.split(): # 1

Lib/test/test_peepholer.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -785,15 +785,13 @@ def f(a, b, c):
785785
c, b, a = a, b, c
786786
self.assertNotInBytecode(f, "SWAP")
787787

788-
@unittest.expectedFailure # TODO: RUSTPYTHON
789788
def test_static_swaps_match_mapping(self):
790789
for a, b, c in product("_a", "_b", "_c"):
791790
pattern = f"{{'a': {a}, 'b': {b}, 'c': {c}}}"
792791
with self.subTest(pattern):
793792
code = compile_pattern_with_fast_locals(pattern)
794793
self.assertNotInBytecode(code, "SWAP")
795794

796-
@unittest.expectedFailure # TODO: RUSTPYTHON
797795
def test_static_swaps_match_class(self):
798796
forms = [
799797
"C({}, {}, {})",
@@ -808,7 +806,6 @@ def test_static_swaps_match_class(self):
808806
code = compile_pattern_with_fast_locals(pattern)
809807
self.assertNotInBytecode(code, "SWAP")
810808

811-
@unittest.expectedFailure # TODO: RUSTPYTHON
812809
def test_static_swaps_match_sequence(self):
813810
swaps = {"*_, b, c", "a, *_, c", "a, b, *_"}
814811
forms = ["{}, {}, {}", "{}, {}, *{}", "{}, *{}, {}", "*{}, {}, {}"]
@@ -863,7 +860,6 @@ def f():
863860
y = x + x
864861
self.assertInBytecode(f, 'LOAD_FAST_BORROW_LOAD_FAST_BORROW')
865862

866-
@unittest.expectedFailure # TODO: RUSTPYTHON; RETURN_VALUE
867863
def test_load_fast_unknown_simple(self):
868864
def f():
869865
if condition():
@@ -906,7 +902,6 @@ def f5(x=0):
906902
self.assertInBytecode(f5, 'LOAD_FAST_BORROW')
907903
self.assertNotInBytecode(f5, 'LOAD_FAST_CHECK')
908904

909-
@unittest.expectedFailure # TODO: RUSTPYTHON; RETURN_VALUE
910905
def test_load_fast_known_because_already_loaded(self):
911906
def f():
912907
if condition():

Lib/test/test_pep646_syntax.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,11 @@
305305
{'args': StarredB}
306306
307307
>>> def f3(*args: *b, arg1: int): pass
308-
>>> f3.__annotations__ # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE
308+
>>> f3.__annotations__
309309
{'args': StarredB, 'arg1': <class 'int'>}
310310
311311
>>> def f4(*args: *b, arg1: int = 2): pass
312-
>>> f4.__annotations__ # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE
312+
>>> f4.__annotations__
313313
{'args': StarredB, 'arg1': <class 'int'>}
314314
315315
>>> def f5(*args: *b = (1,)): pass # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE

Lib/test/test_sys_settrace.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,8 +1957,6 @@ def test_jump_out_of_finally_block(output):
19571957
finally:
19581958
output.append(5)
19591959

1960-
# TODO: RUSTPYTHON
1961-
@unittest.expectedFailure
19621960
@jump_test(1, 5, [], (ValueError, "into an 'except'"))
19631961
def test_no_jump_into_bare_except_block(output):
19641962
output.append(1)
@@ -1967,8 +1965,6 @@ def test_no_jump_into_bare_except_block(output):
19671965
except:
19681966
output.append(5)
19691967

1970-
# TODO: RUSTPYTHON
1971-
@unittest.expectedFailure
19721968
@jump_test(1, 5, [], (ValueError, "into an 'except'"))
19731969
def test_no_jump_into_qualified_except_block(output):
19741970
output.append(1)

Lib/test/test_tstring.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def test_conversions(self):
111111
with self.assertRaises(SyntaxError):
112112
eval("t'{num!z}'")
113113

114-
@unittest.expectedFailure # TODO: RUSTPYTHON; ? ++++++
115114
def test_debug_specifier(self):
116115
# Test debug specifier
117116
value = 42

Lib/test/test_typing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4697,7 +4697,6 @@ class D(Generic[T]): pass
46974697
with self.assertRaises(TypeError):
46984698
D[()]
46994699

4700-
@unittest.expectedFailure # TODO: RUSTPYTHON
47014700
def test_generic_init_subclass_not_called_error(self):
47024701
notes = ["Note: this exception may have been caused by "
47034702
r"'GenericTests.test_generic_init_subclass_not_called_error.<locals>.Base.__init_subclass__' "

0 commit comments

Comments
 (0)