summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-01-18 05:47:48 (GMT)
committerGitHub <noreply@github.com>2019-01-18 05:47:48 (GMT)
commit3bcbedc9f1471d957a30a90f9d1251516b422416 (patch)
tree8011052f704ebd4db1a1b77d04f9dc831bf35d2e /Lib/test/test_ast.py
parente55cf024cae203f63b4f78f1b21c1375fe424441 (diff)
downloadcpython-3bcbedc9f1471d957a30a90f9d1251516b422416.zip
cpython-3bcbedc9f1471d957a30a90f9d1251516b422416.tar.gz
cpython-3bcbedc9f1471d957a30a90f9d1251516b422416.tar.bz2
bpo-34850: Emit a warning for "is" and "is not" with a literal. (GH-9642)
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 2c8d8ab..897e705 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -1146,11 +1146,12 @@ class ASTValidatorTests(unittest.TestCase):
tests = [fn for fn in os.listdir(stdlib) if fn.endswith(".py")]
tests.extend(["test/test_grammar.py", "test/test_unpack_ex.py"])
for module in tests:
- fn = os.path.join(stdlib, module)
- with open(fn, "r", encoding="utf-8") as fp:
- source = fp.read()
- mod = ast.parse(source, fn)
- compile(mod, fn, "exec")
+ with self.subTest(module):
+ fn = os.path.join(stdlib, module)
+ with open(fn, "r", encoding="utf-8") as fp:
+ source = fp.read()
+ mod = ast.parse(source, fn)
+ compile(mod, fn, "exec")
class ConstantTests(unittest.TestCase):