summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-11-27 20:37:43 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2005-11-27 20:37:43 (GMT)
commitfcf4435ae02c3962a8ad71a9539877060c694468 (patch)
tree66b05ecac0df3d4105c15ee62f6ea8b520e87312 /Lib/test/test_syntax.py
parent307021f40b227d2bf114b536c37cc41e03fc2aff (diff)
downloadcpython-fcf4435ae02c3962a8ad71a9539877060c694468.zip
cpython-fcf4435ae02c3962a8ad71a9539877060c694468.tar.gz
cpython-fcf4435ae02c3962a8ad71a9539877060c694468.tar.bz2
Improve test coverage. Hope the test_file changes work the same on windows.
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 4838608..14f4c95 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -42,6 +42,18 @@ class SyntaxTestCase(unittest.TestCase):
self._check_error(source, "global")
warnings.filters.pop(0)
+ def test_break_outside_loop(self):
+ self._check_error("break", "outside loop")
+
+ def test_delete_deref(self):
+ source = re.sub('(?m)^ *:', '', """\
+ :def foo(x):
+ : def bar():
+ : print x
+ : del x
+ :""")
+ self._check_error(source, "nested scope")
+
def test_main():
test_support.run_unittest(SyntaxTestCase)