summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compiler.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-01-06 19:28:15 (GMT)
committerGeorg Brandl <georg@python.org>2006-01-06 19:28:15 (GMT)
commit39cdfff69161c3f1299172e8cbb4dc1a871e3931 (patch)
tree0740c6155dcc02498de6d00f95cf6482947e35a7 /Lib/test/test_compiler.py
parent74ef694da0a9137336932c890497c14e78acd4be (diff)
downloadcpython-39cdfff69161c3f1299172e8cbb4dc1a871e3931.zip
cpython-39cdfff69161c3f1299172e8cbb4dc1a871e3931.tar.gz
cpython-39cdfff69161c3f1299172e8cbb4dc1a871e3931.tar.bz2
Add compiler test regarding optional arguments.
Diffstat (limited to 'Lib/test/test_compiler.py')
-rw-r--r--Lib/test/test_compiler.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py
index d2f062c..a290812 100644
--- a/Lib/test/test_compiler.py
+++ b/Lib/test/test_compiler.py
@@ -12,7 +12,6 @@ class CompilerTest(unittest.TestCase):
# standard library and its test suite. This doesn't verify
# that any of the code is correct, merely the compiler is able
# to generate some kind of code for it.
-
libdir = os.path.dirname(unittest.__file__)
testdir = os.path.dirname(test.test_support.__file__)
@@ -36,6 +35,10 @@ class CompilerTest(unittest.TestCase):
def testNewClassSyntax(self):
compiler.compile("class foo():pass\n\n","<string>","exec")
+
+ def testSyntaxErrors(self):
+ self.assertRaises(SyntaxError, compiler.compile,
+ "def foo(a=1,b):pass\n\n", "<string>", "exec")
def testLineNo(self):
# Test that all nodes except Module have a correct lineno attribute.