Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Mark failing tests
  • Loading branch information
ShaharNaveh committed Sep 3, 2025
commit 87dd525a7b68ae5fc0d4b4add1f532e05bef5ed2
13 changes: 13 additions & 0 deletions Lib/test/test_future_stmt/test_future.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def test_future_multiple_features(self):
):
from test.test_future_stmt import test_future_multiple_features

@unittest.expectedFailure # TODO: RUSTPYTHON; Wrong error message
def test_unknown_future_flag(self):
code = """
from __future__ import nested_scopes
Expand All @@ -91,6 +92,7 @@ def test_unknown_future_flag(self):
message='future feature rested_snopes is not defined', offset=24,
)

@unittest.expectedFailure # TODO: RUSTPYTHON; Wrong error message
def test_future_import_not_on_top(self):
code = """
import some_module
Expand All @@ -111,6 +113,7 @@ def test_future_import_not_on_top(self):
"""
self.assertSyntaxError(code, lineno=3)

@unittest.expectedFailure # TODO: RUSTPYTHON; Wrong error message
def test_future_import_with_extra_string(self):
code = """
'''Docstring'''
Expand All @@ -119,6 +122,7 @@ def test_future_import_with_extra_string(self):
"""
self.assertSyntaxError(code, lineno=3, parametrize_docstring=False)

@unittest.expectedFailure # TODO: RUSTPYTHON; Wrong error message
def test_multiple_import_statements_on_same_line(self):
# With `\`:
code = """
Expand All @@ -133,12 +137,14 @@ def test_multiple_import_statements_on_same_line(self):
"""
self.assertSyntaxError(code, offset=54)

@unittest.expectedFailure # TODO: RUSTPYTHON; Wrong error message
def test_future_import_star(self):
code = """
from __future__ import *
"""
self.assertSyntaxError(code, message='future feature * is not defined', offset=24)

@unittest.expectedFailure # TODO: RUSTPYTHON; Wrong error message
def test_future_import_braces(self):
code = """
from __future__ import braces
Expand All @@ -151,6 +157,7 @@ def test_future_import_braces(self):
"""
self.assertSyntaxError(code, message='not a chance', offset=39)

@unittest.expectedFailure # TODO: RUSTPYTHON; Wrong error message
def test_module_with_future_import_not_on_top(self):
with self.assertRaises(SyntaxError) as cm:
from test.test_future_stmt import badsyntax_future
Expand Down Expand Up @@ -183,6 +190,7 @@ def test_syntactical_future_repl(self):
out = kill_python(p)
self.assertNotIn(b'SyntaxError: invalid syntax', out)

@unittest.expectedFailure # TODO: RUSTPYTHON; SyntaxError: future feature spam is not defined
def test_future_dotted_import(self):
with self.assertRaises(ImportError):
exec("from .__future__ import spam")
Expand Down Expand Up @@ -259,6 +267,7 @@ def _exec_future(self, code):
)
return scope

@unittest.expectedFailure # TODO: RUSTPYTHON; 'a,' != '(a,)'
def test_annotations(self):
eq = self.assertAnnotationEqual
eq('...')
Expand Down Expand Up @@ -423,6 +432,7 @@ def test_annotations(self):
eq('(((a, b)))', '(a, b)')
eq("1 + 2 + 3")

@unittest.expectedFailure # TODO: RUSTPYTHON; "f'{x=!r}'" != "f'x={x!r}'"
def test_fstring_debug_annotations(self):
# f-strings with '=' don't round trip very well, so set the expected
# result explicitly.
Expand All @@ -433,6 +443,7 @@ def test_fstring_debug_annotations(self):
self.assertAnnotationEqual("f'{x=!a}'", expected="f'x={x!a}'")
self.assertAnnotationEqual("f'{x=!s:*^20}'", expected="f'x={x!s:*^20}'")

@unittest.expectedFailure # TODO: RUSTPYTHON; '1e309, 1e309j' != '(1e309, 1e309j)'
def test_infinity_numbers(self):
inf = "1e" + repr(sys.float_info.max_10_exp + 1)
infj = f"{inf}j"
Expand All @@ -445,6 +456,7 @@ def test_infinity_numbers(self):
self.assertAnnotationEqual("('inf', 1e1000, 'infxxx', 1e1000j)", expected=f"('inf', {inf}, 'infxxx', {infj})")
self.assertAnnotationEqual("(1e1000, (1e1000j,))", expected=f"({inf}, ({infj},))")

@unittest.expectedFailure # TODO: RUSTPYTHON; SyntaxError not raised
def test_annotation_with_complex_target(self):
with self.assertRaises(SyntaxError):
exec(
Expand All @@ -468,6 +480,7 @@ def bar():
self.assertEqual(foo.__code__.co_cellvars, ())
self.assertEqual(foo().__code__.co_freevars, ())

@unittest.expectedFailure # TODO: RUSTPYTHON; "f'{x=!r}'" != "f'x={x!r}'"
def test_annotations_forbidden(self):
with self.assertRaises(SyntaxError):
self._exec_future("test: (yield)")
Expand Down
Loading