Skip to content

Commit 94c901e

Browse files
Lib/test: drop expectedFailure markers that now pass
Removes 37 stale TODO: RUSTPYTHON markers across 26 test files now that the corresponding error messages match CPython 3.14: async-for errors (test_coroutines), str()/Template/concat errors (test_str, test_tstring, string_tests), unraisable reports (test_exceptions, test_generators), __annotate__ qualnames (test_type_annotations), constructor arity (test_range, test_posix, test_sqlite3, test_struct), find-family messages (test_bytes), attribute errors (test_class, test_descr, test_descrtut), exec/eval arguments (test_pdb, test_extcall), map (test_itertools), marshal readers, lzma filter specs, enum, json scanstring (C variant only; the pure-Python scanner still lacks the OverflowError, so that variant keeps a scoped marker), mmap resize and pdb's exec/eval doctests. Assisted-by: ZCode:GLM-5.3
1 parent 5605a25 commit 94c901e

26 files changed

Lines changed: 16 additions & 37 deletions

Lib/test/string_tests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,6 @@ def test___contains__(self):
13011301
self.checkequal(False, 'asd', '__contains__', 'asdf')
13021302
self.checkequal(False, '', '__contains__', 'asdf')
13031303

1304-
@unittest.expectedFailure # TODO: RUSTPYTHON
13051304
def test_subscript(self):
13061305
self.checkequal('a', 'abc', '__getitem__', 0)
13071306
self.checkequal('c', 'abc', '__getitem__', -1)
@@ -1556,7 +1555,6 @@ def test_none_arguments(self):
15561555
self.checkequal(True, s, 'startswith', 'h', None, -2)
15571556
self.checkequal(False, s, 'startswith', 'x', None, None)
15581557

1559-
@unittest.expectedFailure # TODO: RUSTPYTHON
15601558
def test_find_etc_raise_correct_error_messages(self):
15611559
# issue 11828
15621560
s = 'hello'

Lib/test/test_asyncgen.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,6 @@ async def run():
18351835
res = self.loop.run_until_complete(run())
18361836
self.assertEqual(res, [i * 2 for i in range(1, 10)])
18371837

1838-
@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: __aiter__
18391838
def test_async_gen_expression_incorrect(self):
18401839
async def ag():
18411840
yield 42

Lib/test/test_bytes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,6 @@ def test_integer_arguments_out_of_byte_range(self):
10211021
self.assertRaises(ValueError, method, 256)
10221022
self.assertRaises(ValueError, method, 9999)
10231023

1024-
@unittest.expectedFailure # TODO: RUSTPYTHON
10251024
def test_find_etc_raise_correct_error_messages(self):
10261025
# issue 11828
10271026
b = self.type2test(b'hello')

Lib/test/test_class.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,6 @@ class A:
691691
with self.assertRaisesRegex(AttributeError, error_msg):
692692
del A.x
693693

694-
@unittest.expectedFailure # TODO: RUSTPYTHON
695694
def testObjectAttributeAccessErrorMessages(self):
696695
class A:
697696
pass

Lib/test/test_coroutines.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,6 @@ async def test3():
16041604
self.assertEqual(buffer, [i for i in range(1, 21)] +
16051605
['what?', 'end'])
16061606

1607-
@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: __aiter__
16081607
def test_for_2(self):
16091608
tup = (1, 2, 3)
16101609
refs_before = sys.getrefcount(tup)
@@ -1620,7 +1619,6 @@ async def foo():
16201619

16211620
self.assertEqual(sys.getrefcount(tup), refs_before)
16221621

1623-
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: "that does not implement __anext__" does not match "'async for' requires an iterator with __anext__ method, got I"
16241622
def test_for_3(self):
16251623
class I:
16261624
def __aiter__(self):
@@ -1641,7 +1639,6 @@ async def foo():
16411639

16421640
self.assertEqual(sys.getrefcount(aiter), refs_before)
16431641

1644-
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: "async for' received an invalid object.*__anext__.*tuple" does not match "'tuple' object is not an iterator"
16451642
def test_for_4(self):
16461643
class I:
16471644
def __aiter__(self):
@@ -1789,7 +1786,6 @@ async def foo():
17891786
run_async(foo())
17901787
self.assertEqual(CNT, 0)
17911788

1792-
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: "an invalid object from __anext__" does not match "'F' object is not an iterator"
17931789
def test_for_11(self):
17941790
class F:
17951791
def __aiter__(self):

Lib/test/test_descr.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4074,7 +4074,6 @@ def test_ipow_exception_text(self):
40744074
y = x ** 2
40754075
self.assertIn('unsupported operand type(s) for **', str(cm.exception))
40764076

4077-
@unittest.expectedFailure # TODO: RUSTPYTHON
40784077
def test_pow_wrapper_error_messages(self):
40794078
self.assertRaisesRegex(TypeError,
40804079
'expected 1 or 2 arguments, got 0',

Lib/test/test_descrtut.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def merge(self, other):
136136
>>> a.default = -1
137137
>>> a[1]
138138
-1
139-
>>> a.x1 = 1 # TODO: RUSTPYTHON; # doctest: +EXPECTED_FAILURE
139+
>>> a.x1 = 1
140140
Traceback (most recent call last):
141141
File "<stdin>", line 1, in ?
142142
AttributeError: 'defaultdict2' object has no attribute 'x1' and no __dict__ for setting new attributes

Lib/test/test_enum.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3036,7 +3036,6 @@ class ThirdFailedStrEnum(StrEnum):
30363036
one = '1'
30373037
two = b'2', 'ascii', 9
30383038

3039-
@unittest.expectedFailure # TODO: RUSTPYTHON; fails on encoding testing : TypeError: Expected type 'str' but 'builtin_function_or_method' found
30403039
def test_custom_strenum(self):
30413040
class CustomStrEnum(str, Enum):
30423041
pass

Lib/test/test_exceptions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,6 @@ def test_errno_ENOTDIR(self):
17241724
os.listdir(__file__)
17251725
self.assertEqual(cm.exception.errno, errno.ENOTDIR, cm.exception)
17261726

1727-
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: None != 'Exception ignored while calling dealloca[83 chars]200>'
17281727
def test_unraisable(self):
17291728
# Issue #22836: PyErr_WriteUnraisable() should give sensible reports
17301729
class BrokenDel:

Lib/test/test_extcall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@
442442
... False
443443
True
444444
445-
>>> id(1, **{'foo': 1}) # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE
445+
>>> id(1, **{'foo': 1})
446446
Traceback (most recent call last):
447447
...
448448
TypeError: id() takes no keyword arguments

0 commit comments

Comments
 (0)