diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-02-08 21:45:06 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-02-08 21:45:06 (GMT) |
commit | 15a3095d64e96d0fe7448270f2c5b0bf22f9c4e1 (patch) | |
tree | da112b21f47896fd48d61ac70429cf5001d89f90 /Lib/test/test_ast.py | |
parent | 896632ea6b2b03815ae948aea05972b4e51247ed (diff) | |
download | cpython-15a3095d64e96d0fe7448270f2c5b0bf22f9c4e1.zip cpython-15a3095d64e96d0fe7448270f2c5b0bf22f9c4e1.tar.gz cpython-15a3095d64e96d0fe7448270f2c5b0bf22f9c4e1.tar.bz2 |
compiler: don't emit SyntaxWarning on const stmt
Issue #26204: the compiler doesn't emit SyntaxWarning warnings anymore when
constant statements are ignored.
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r-- | Lib/test/test_ast.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index dbcd9f7..a025c20 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -3,7 +3,6 @@ import dis import os import sys import unittest -import warnings import weakref from test import support @@ -240,10 +239,8 @@ class AST_Tests(unittest.TestCase): ast_tree = compile(i, "?", kind, ast.PyCF_ONLY_AST) self.assertEqual(to_tuple(ast_tree), o) self._assertTrueorder(ast_tree, (0, 0)) - with warnings.catch_warnings(): - warnings.filterwarnings('ignore', category=SyntaxWarning) - with self.subTest(action="compiling", input=i, kind=kind): - compile(ast_tree, "?", kind) + with self.subTest(action="compiling", input=i, kind=kind): + compile(ast_tree, "?", kind) def test_slice(self): slc = ast.parse("x[::]").body[0].value.slice |