Skip to content

Commit 4f6ee95

Browse files
committed
test_unparse
1 parent 032841c commit 4f6ee95

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Lib/test/test_unparse.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pathlib
66
import random
77
import tokenize
8+
import warnings
89
import ast
910
from test.support.ast_helper import ASTTestMixin
1011

@@ -839,13 +840,16 @@ def files_to_test(cls):
839840
return items
840841

841842
def test_files(self):
842-
for item in self.files_to_test():
843-
if test.support.verbose:
844-
print(f"Testing {item.absolute()}")
843+
with warnings.catch_warnings():
844+
warnings.simplefilter('ignore', SyntaxWarning)
845845

846-
with self.subTest(filename=item):
847-
source = read_pyfile(item)
848-
self.check_ast_roundtrip(source)
846+
for item in self.files_to_test():
847+
if test.support.verbose:
848+
print(f"Testing {item.absolute()}")
849+
850+
with self.subTest(filename=item):
851+
source = read_pyfile(item)
852+
self.check_ast_roundtrip(source)
849853

850854

851855
if __name__ == "__main__":

0 commit comments

Comments
 (0)