- Re-enable lib2to3's test_parser.py tests, though with an expected failure

(see issue 13125).
This commit is contained in:
Barry Warsaw 2011-10-07 15:26:54 -04:00
commit 146177503c
2 changed files with 2 additions and 4 deletions

View file

@ -166,7 +166,7 @@ class TestParserIdempotency(support.TestCase):
encoding = tokenize.detect_encoding(fp.readline)[0] encoding = tokenize.detect_encoding(fp.readline)[0]
self.assertTrue(encoding is not None, self.assertTrue(encoding is not None,
"can't detect encoding for %s" % filepath) "can't detect encoding for %s" % filepath)
with open(filepath, "r") as fp: with open(filepath, "r", encoding=encoding) as fp:
source = fp.read() source = fp.read()
try: try:
tree = driver.parse_string(source) tree = driver.parse_string(source)
@ -174,8 +174,6 @@ class TestParserIdempotency(support.TestCase):
print('ParseError on file', filepath, err) print('ParseError on file', filepath, err)
continue continue
new = str(tree) new = str(tree)
if encoding:
new = new.encode(encoding)
if diff(filepath, new): if diff(filepath, new):
self.fail("Idempotency failed: %s" % filepath) self.fail("Idempotency failed: %s" % filepath)

View file

@ -9,7 +9,7 @@ from test.support import run_unittest
def suite(): def suite():
tests = unittest.TestSuite() tests = unittest.TestSuite()
loader = unittest.TestLoader() loader = unittest.TestLoader()
for m in (test_fixers, test_pytree,test_util, test_refactor, test_parser, for m in (test_fixers, test_pytree, test_util, test_refactor, test_parser,
test_main_): test_main_):
tests.addTests(loader.loadTestsFromModule(m)) tests.addTests(loader.loadTestsFromModule(m))
return tests return tests