🌐 AI搜索 & 代理 主页
Skip to content

Commit 7bc0197

Browse files
committed
Mark/unmark tests
1 parent 327052e commit 7bc0197

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Lib/test/test_tokenize.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def check_tokenize(self, s, expected):
5151
[" ENCODING 'utf-8' (0, 0) (0, 0)"] +
5252
expected.rstrip().splitlines())
5353

54+
@unittest.expectedFailure # TODO: RUSTPYTHON
5455
def test_invalid_readline(self):
5556
def gen():
5657
yield "sdfosdg"
@@ -272,7 +273,6 @@ def test_float(self):
272273
NUMBER '3.14e159' (1, 4) (1, 12)
273274
""")
274275

275-
@unittest.expectedFailure # TODO: RUSTPYTHON
276276
def test_underscore_literals(self):
277277
def number_token(s):
278278
f = BytesIO(s.encode('utf-8'))
@@ -717,7 +717,6 @@ def test_comparison(self):
717717
NAME 'pass' (1, 84) (1, 88)
718718
""")
719719

720-
@unittest.skip('TODO: RUSTPYTHON; This fails but the one in GenerateTokensTest passes')
721720
def test_shift(self):
722721
# Shift
723722
self.check_tokenize("x = 1 << 1 >> 5", """\
@@ -753,7 +752,6 @@ def test_additive(self):
753752
OP ']' (1, 36) (1, 37)
754753
""")
755754

756-
@unittest.skip('TODO: RUSTPYTHON; This fails but the one in GenerateTokensTest passes')
757755
def test_multiplicative(self):
758756
# Multiplicative
759757
self.check_tokenize("x = 1//1*1/5*12%0x12@42", """\
@@ -774,7 +772,6 @@ def test_multiplicative(self):
774772
NUMBER '42' (1, 21) (1, 23)
775773
""")
776774

777-
@unittest.skip('TODO: RUSTPYTHON; This fails but the one in GenerateTokensTest passes')
778775
def test_unary(self):
779776
# Unary
780777
self.check_tokenize("~1 ^ 1 & 1 |1 ^ -1", """\
@@ -1292,6 +1289,7 @@ def _testFile(self, filename):
12921289
with open(path, 'rb') as f:
12931290
TestRoundtrip.check_roundtrip(self, f)
12941291

1292+
@unittest.expectedFailure # TODO: RUSTPYTHON
12951293
def test_utf8_coding_cookie_and_no_utf8_bom(self):
12961294
f = 'tokenize_tests-utf8-coding-cookie-and-no-utf8-bom-sig.txt'
12971295
self._testFile(f)
@@ -1307,10 +1305,12 @@ def test_latin1_coding_cookie_and_utf8_bom(self):
13071305
f = 'tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt'
13081306
self.assertRaises(SyntaxError, self._testFile, f)
13091307

1308+
@unittest.expectedFailure # TODO: RUSTPYTHON
13101309
def test_no_coding_cookie_and_utf8_bom(self):
13111310
f = 'tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt'
13121311
self._testFile(f)
13131312

1313+
@unittest.expectedFailure # TODO: RUSTPYTHON
13141314
def test_utf8_coding_cookie_and_utf8_bom(self):
13151315
f = 'tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt'
13161316
self._testFile(f)
@@ -1737,6 +1737,7 @@ def test_pathological_trailing_whitespace(self):
17371737
# See http://bugs.python.org/issue16152
17381738
self.assertExactTypeEqual('@ ', token.AT)
17391739

1740+
@unittest.expectedFailure # TODO: RUSTPYTHON
17401741
def test_comment_at_the_end_of_the_source_without_newline(self):
17411742
# See http://bugs.python.org/issue44667
17421743
source = 'b = 1\n\n#test'
@@ -1755,6 +1756,7 @@ def test_comment_at_the_end_of_the_source_without_newline(self):
17551756
tokens = list(tokenize.tokenize(BytesIO(source.encode('utf-8')).readline))
17561757
self.assertEqual(tokens, expected_tokens)
17571758

1759+
@unittest.expectedFailure # TODO: RUSTPYTHON
17581760
def test_newline_and_space_at_the_end_of_the_source_without_newline(self):
17591761
# See https://github.com/python/cpython/issues/105435
17601762
source = 'a\n '
@@ -1895,6 +1897,7 @@ def check_line_extraction(self, f):
18951897
continue
18961898
self.assertEqual(tok.string, tok.line[tok.start[1]: tok.end[1]])
18971899

1900+
@unittest.expectedFailure # TODO: RUSTPYTHON
18981901
def test_roundtrip(self):
18991902
# There are some standard formatting practices that are easy to get right.
19001903

@@ -1991,6 +1994,7 @@ def test_roundtrip(self):
19911994
self.check_roundtrip(case)
19921995

19931996

1997+
@unittest.expectedFailure # TODO: RUSTPYTHON
19941998
def test_continuation(self):
19951999
# Balancing continuation
19962000
self.check_roundtrip("a = (3,4, \n"
@@ -2004,6 +2008,7 @@ def test_continuation(self):
20042008
"+ len(z) - z[\n"
20052009
"'b']\n")
20062010

2011+
@unittest.expectedFailure # TODO: RUSTPYTHON
20072012
def test_backslash_continuation(self):
20082013
# Backslash means line continuation, except for comments
20092014
self.check_roundtrip("x=1+\\\n"
@@ -2017,6 +2022,7 @@ def test_string_concatenation(self):
20172022
# Two string literals on the same line
20182023
self.check_roundtrip("'' ''")
20192024

2025+
@unittest.skip("TODO: RUSTPYTHON; slow and fails")
20202026
def test_random_files(self):
20212027
# Test roundtrip on random python modules.
20222028
# pass the '-ucpu' option to process the full directory.
@@ -2042,6 +2048,7 @@ def roundtrip(self, code):
20422048
code = code.encode('utf-8')
20432049
return tokenize.untokenize(tokenize.tokenize(BytesIO(code).readline)).decode('utf-8')
20442050

2051+
@unittest.expectedFailure # TODO: RUSTPYTHON
20452052
def test_indentation_semantics_retained(self):
20462053
"""
20472054
Ensure that although whitespace might be mutated in a roundtrip,
@@ -2094,6 +2101,7 @@ def check_tokenize(self, s, expected):
20942101
)
20952102
self.assertEqual(result, expected.rstrip().splitlines())
20962103

2104+
@unittest.expectedFailure # TODO: RUSTPYTHON
20972105
def test_encoding(self):
20982106
def readline(encoding):
20992107
yield "1+1".encode(encoding)

0 commit comments

Comments
 (0)