diff options
author | Shantanu <hauntsaninja@users.noreply.github.com> | 2020-05-11 21:53:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 21:53:58 (GMT) |
commit | 27c0d9b54abaa4112d5a317b8aa78b39ad60a808 (patch) | |
tree | 94bf73f5275f8156008249528b2997cfee8d47a6 /Lib/test/test_grammar.py | |
parent | 86d69444e7cfe758212956df0be0ec7b8a4251a6 (diff) | |
download | cpython-27c0d9b54abaa4112d5a317b8aa78b39ad60a808.zip cpython-27c0d9b54abaa4112d5a317b8aa78b39ad60a808.tar.gz cpython-27c0d9b54abaa4112d5a317b8aa78b39ad60a808.tar.bz2 |
bpo-40334: produce specialized errors for invalid del targets (GH-19911)
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r-- | Lib/test/test_grammar.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index c24d352..02ba8a8 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -801,6 +801,23 @@ class GrammarTests(unittest.TestCase): del abc del x, y, (z, xyz) + x, y, z = "xyz" + del x + del y, + del (z) + del () + + a, b, c, d, e, f, g = "abcdefg" + del a, (b, c), (d, (e, f)) + + a, b, c, d, e, f, g = "abcdefg" + del a, [b, c], (d, [e, f]) + + abcd = list("abcd") + del abcd[1:2] + + compile("del a, (b[0].c, (d.e, f.g[1:2])), [h.i.j], ()", "<testcase>", "exec") + def test_pass_stmt(self): # 'pass' pass |