Skip to content

Commit 2da4b70

Browse files
committed
Mark failing tests.
1 parent f58014e commit 2da4b70

File tree

1 file changed

+60
-17
lines changed

1 file changed

+60
-17
lines changed

Lib/test/test_syntax.py

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@
555555
Traceback (most recent call last):
556556
SyntaxError: expected default value expression
557557
558-
>>> import ast; ast.parse('''
558+
# TODO: RUSTPYTHON NameError: name 'PyCF_TYPE_COMMENTS' is not defined
559+
>>> import ast; ast.parse(''' # doctest: +SKIP
559560
... def f(
560561
... *, # type: int
561562
... a, # type: int
@@ -581,30 +582,46 @@
581582
>>> L = range(10)
582583
>>> f(x for x in L)
583584
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
584-
>>> f(x for x in L, 1)
585+
586+
# TODO: RUSTPYTHON does not raise.
587+
>>> f(x for x in L, 1) # doctest: +SKIP
585588
Traceback (most recent call last):
586589
SyntaxError: Generator expression must be parenthesized
587-
>>> f(x for x in L, y=1)
590+
591+
# TODO: RUSTPYTHON does not raise.
592+
>>> f(x for x in L, y=1) # doctest: +SKIP
588593
Traceback (most recent call last):
589594
SyntaxError: Generator expression must be parenthesized
590-
>>> f(x for x in L, *[])
595+
596+
# TODO: RUSTPYTHON does not raise.
597+
>>> f(x for x in L, *[]) # doctest: +SKIP
591598
Traceback (most recent call last):
592599
SyntaxError: Generator expression must be parenthesized
593-
>>> f(x for x in L, **{})
600+
601+
# TODO: RUSTPYTHON does not raise.
602+
>>> f(x for x in L, **{}) # doctest: +SKIP
594603
Traceback (most recent call last):
595604
SyntaxError: Generator expression must be parenthesized
596-
>>> f(L, x for x in L)
605+
606+
# TODO: RUSTPYTHON does not raise.
607+
>>> f(L, x for x in L) # doctest: +SKIP
597608
Traceback (most recent call last):
598609
SyntaxError: Generator expression must be parenthesized
599-
>>> f(x for x in L, y for y in L)
610+
611+
# TODO: RUSTPYTHON does not raise.
612+
>>> f(x for x in L, y for y in L) # doctest: +SKIP
600613
Traceback (most recent call last):
601614
SyntaxError: Generator expression must be parenthesized
602-
>>> f(x for x in L,)
615+
616+
# TODO: RUSTPYTHON does not raise.
617+
>>> f(x for x in L,) # doctest: +SKIP
603618
Traceback (most recent call last):
604619
SyntaxError: Generator expression must be parenthesized
605620
>>> f((x for x in L), 1)
606621
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
607-
>>> class C(x for x in L):
622+
623+
# TODO: RUSTPYTHON TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
624+
>>> class C(x for x in L): # doctest: +SKIP
608625
... pass
609626
Traceback (most recent call last):
610627
SyntaxError: invalid syntax
@@ -740,7 +757,9 @@
740757
>>> f(__debug__=1)
741758
Traceback (most recent call last):
742759
SyntaxError: cannot assign to __debug__
743-
>>> __debug__: int
760+
761+
# TODO: RUSTPYTHON NameError: name '__annotations__' is not defined
762+
>>> __debug__: int # doctest: +SKIP
744763
Traceback (most recent call last):
745764
SyntaxError: cannot assign to __debug__
746765
@@ -1574,20 +1593,24 @@
15741593
# Check that we dont raise the "trailing comma" error if there is more
15751594
# input to the left of the valid part that we parsed.
15761595
1577-
>>> from t import x,y, and 3
1596+
>>> from t import x,y, and 3
15781597
Traceback (most recent call last):
15791598
SyntaxError: invalid syntax
15801599
1581-
>>> (): int
1600+
# TODO: RUSTPYTHON nothing raised.
1601+
>>> (): int # doctest: +SKIP
15821602
Traceback (most recent call last):
15831603
SyntaxError: only single target (not tuple) can be annotated
1584-
>>> []: int
1604+
# TODO: RUSTPYTHON nothing raised.
1605+
>>> []: int # doctest: +SKIP
15851606
Traceback (most recent call last):
15861607
SyntaxError: only single target (not list) can be annotated
1587-
>>> (()): int
1608+
# TODO: RUSTPYTHON nothing raised.
1609+
>>> (()): int # doctest: +SKIP
15881610
Traceback (most recent call last):
15891611
SyntaxError: only single target (not tuple) can be annotated
1590-
>>> ([]): int
1612+
# TODO: RUSTPYTHON nothing raised.
1613+
>>> ([]): int # doctest: +SKIP
15911614
Traceback (most recent call last):
15921615
SyntaxError: only single target (not list) can be annotated
15931616
@@ -1611,7 +1634,8 @@
16111634
16121635
Corner-cases that used to crash:
16131636
1614-
>>> def f(**__debug__): pass
1637+
# TODO: RUSTPYTHON nothing raised.
1638+
>>> def f(**__debug__): pass # doctest: +SKIP
16151639
Traceback (most recent call last):
16161640
SyntaxError: cannot assign to __debug__
16171641
@@ -1843,6 +1867,8 @@ def _check_error(self, code, errtext,
18431867
else:
18441868
self.fail("compile() did not raise SyntaxError")
18451869

1870+
# TODO: RUSTPYTHON
1871+
@unittest.expectedFailure
18461872
def test_expression_with_assignment(self):
18471873
self._check_error(
18481874
"print(end1 + end2 = ' ')",
@@ -1945,6 +1971,8 @@ def test_break_outside_loop(self):
19451971
self._check_error("class C:\n if 1: pass\n else: break",
19461972
"outside loop")
19471973

1974+
# TODO: RUSTPYTHON
1975+
@unittest.expectedFailure
19481976
def test_continue_outside_loop(self):
19491977
self._check_error("if 0: continue", "not properly in loop")
19501978
self._check_error("if 0: continue\nelse: x=1", "not properly in loop")
@@ -1970,6 +1998,8 @@ def test_kwargs_last(self):
19701998
self._check_error("int(base=10, '2')",
19711999
"positional argument follows keyword argument")
19722000

2001+
# TODO: RUSTPYTHON
2002+
@unittest.expectedFailure
19732003
def test_kwargs_last2(self):
19742004
self._check_error("int(**{'base': 10}, '2')",
19752005
"positional argument follows "
@@ -1980,11 +2010,15 @@ def test_kwargs_last3(self):
19802010
"iterable argument unpacking follows "
19812011
"keyword argument unpacking")
19822012

2013+
# TODO: RUSTPYTHON
2014+
@unittest.expectedFailure
19832015
def test_generator_in_function_call(self):
19842016
self._check_error("foo(x, y for y in range(3) for z in range(2) if z , p)",
19852017
"Generator expression must be parenthesized",
19862018
lineno=1, end_lineno=1, offset=11, end_offset=53)
19872019

2020+
# TODO: RUSTPYTHON
2021+
@unittest.expectedFailure
19882022
def test_empty_line_after_linecont(self):
19892023
# See issue-40847
19902024
s = r"""\
@@ -2039,6 +2073,8 @@ def test_nested_named_except_blocks(self):
20392073
code += f"{' '*4*12}pass"
20402074
self._check_error(code, "too many statically nested blocks")
20412075

2076+
# TODO: RUSTPYTHON
2077+
@unittest.expectedFailure
20422078
def test_barry_as_flufl_with_syntax_errors(self):
20432079
# The "barry_as_flufl" rule can produce some "bugs-at-a-distance" if
20442080
# is reading the wrong token in the presence of syntax errors later
@@ -2056,6 +2092,8 @@ def func2():
20562092
"""
20572093
self._check_error(code, "expected ':'")
20582094

2095+
# TODO: RUSTPYTHON
2096+
@unittest.expectedFailure
20592097
def test_invalid_line_continuation_error_position(self):
20602098
self._check_error(r"a = 3 \ 4",
20612099
"unexpected character after line continuation character",
@@ -2075,6 +2113,8 @@ def test_invalid_line_continuation_left_recursive(self):
20752113
self._check_error("A.\u03bc\\\n",
20762114
"unexpected EOF while parsing")
20772115

2116+
# TODO: RUSTPYTHON
2117+
@unittest.expectedFailure
20782118
def test_error_parenthesis(self):
20792119
for paren in "([{":
20802120
self._check_error(paren + "1 + 2", f"\\{paren}' was never closed")
@@ -2085,6 +2125,8 @@ def test_error_parenthesis(self):
20852125
for paren in ")]}":
20862126
self._check_error(paren + "1 + 2", f"unmatched '\\{paren}'")
20872127

2128+
# TODO: RUSTPYTHON
2129+
@unittest.expectedFailure
20882130
def test_invisible_characters(self):
20892131
self._check_error('print\x17("Hello")', "invalid non-printable character")
20902132

@@ -2166,7 +2208,8 @@ def test_deep_invalid_rule(self):
21662208

21672209

21682210
def load_tests(loader, tests, pattern):
2169-
tests.addTest(doctest.DocTestSuite())
2211+
# TODO: RUSTPYTHON Eventually remove the optionflags for ingoring exception details.
2212+
tests.addTest(doctest.DocTestSuite(optionflags=doctest.IGNORE_EXCEPTION_DETAIL))
21702213
return tests
21712214

21722215

0 commit comments

Comments
 (0)