diff options
author | Weipeng Hong <hongweichen8888@sina.com> | 2021-12-10 23:44:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 23:44:26 (GMT) |
commit | 28179aac796ed1debdce336c4b8ca18e8475d40d (patch) | |
tree | 52cf22ebe879402024dfda46be582969c06f3d29 /Lib/test/test_compile.py | |
parent | 98e506ae8a7997658a08fbf77ac016d200588cb3 (diff) | |
download | cpython-28179aac796ed1debdce336c4b8ca18e8475d40d.zip cpython-28179aac796ed1debdce336c4b8ca18e8475d40d.tar.gz cpython-28179aac796ed1debdce336c4b8ca18e8475d40d.tar.bz2 |
bpo-42918: Improve build-in function compile() in mode 'single' (GH-29934)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r-- | Lib/test/test_compile.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index f72c7ca..f4ed6c7 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -504,6 +504,7 @@ if 1: self.compile_single("if x:\n f(x)") self.compile_single("if x:\n f(x)\nelse:\n g(x)") self.compile_single("class T:\n pass") + self.compile_single("c = '''\na=1\nb=2\nc=3\n'''") def test_bad_single_statement(self): self.assertInvalidSingle('1\n2') @@ -514,6 +515,7 @@ if 1: self.assertInvalidSingle('f()\n# blah\nblah()') self.assertInvalidSingle('f()\nxy # blah\nblah()') self.assertInvalidSingle('x = 5 # comment\nx = 6\n') + self.assertInvalidSingle("c = '''\nd=1\n'''\na = 1\n\nb = 2\n") def test_particularly_evil_undecodable(self): # Issue 24022 |