summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-11-24 04:09:03 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-11-24 04:09:03 (GMT)
commit9dfe6a8862f6125cc4b22bd8779126ac29839bab (patch)
tree937f221d8bdfad1747e59e825e8c3fe4ea3d9ef1 /Lib/test
parent39ff59e57745854ba7d1a220fbc5b5d70c338bd0 (diff)
downloadcpython-9dfe6a8862f6125cc4b22bd8779126ac29839bab.zip
cpython-9dfe6a8862f6125cc4b22bd8779126ac29839bab.tar.gz
cpython-9dfe6a8862f6125cc4b22bd8779126ac29839bab.tar.bz2
#4396 make the parser module correctly validate the with syntax
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_parser.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index 94b6113..1069606 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -196,6 +196,10 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
def test_assert(self):
self.check_suite("assert alo < ahi and blo < bhi\n")
+ def test_with(self):
+ self.check_suite("with open('x'): pass\n")
+ self.check_suite("with open('x') as f: pass\n")
+
def test_position(self):
# An absolutely minimal test of position information. Better
# tests would be a big project.