mirror of
https://github.com/python/cpython.git
synced 2025-10-15 03:10:29 +00:00
- Re-enable lib2to3's test_parser.py tests, though with an expected failure
(see issue 13125).
This commit is contained in:
commit
146177503c
2 changed files with 2 additions and 4 deletions
|
@ -166,7 +166,7 @@ class TestParserIdempotency(support.TestCase):
|
|||
encoding = tokenize.detect_encoding(fp.readline)[0]
|
||||
self.assertTrue(encoding is not None,
|
||||
"can't detect encoding for %s" % filepath)
|
||||
with open(filepath, "r") as fp:
|
||||
with open(filepath, "r", encoding=encoding) as fp:
|
||||
source = fp.read()
|
||||
try:
|
||||
tree = driver.parse_string(source)
|
||||
|
@ -174,8 +174,6 @@ class TestParserIdempotency(support.TestCase):
|
|||
print('ParseError on file', filepath, err)
|
||||
continue
|
||||
new = str(tree)
|
||||
if encoding:
|
||||
new = new.encode(encoding)
|
||||
if diff(filepath, new):
|
||||
self.fail("Idempotency failed: %s" % filepath)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue