mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
bpo-34850: Emit a warning for "is" and "is not" with a literal. (GH-9642)
This commit is contained in:
parent
e55cf024ca
commit
3bcbedc9f1
5 changed files with 95 additions and 11 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue