summaryrefslogtreecommitdiff
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-02-08 22:45:06 +0100
committerVictor Stinner <victor.stinner@gmail.com>2016-02-08 22:45:06 +0100
commit15a3095d64e96d0fe7448270f2c5b0bf22f9c4e1 (patch)
treeda112b21f47896fd48d61ac70429cf5001d89f90 /Lib/test/test_ast.py
parent896632ea6b2b03815ae948aea05972b4e51247ed (diff)
downloadcpython-git-15a3095d64e96d0fe7448270f2c5b0bf22f9c4e1.tar.gz
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.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index dbcd9f74ff..a025c20006 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