diff options
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r-- | Lib/test/test_compile.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 3801cac..c063855 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -22,6 +22,15 @@ try: except SyntaxError: pass +if verbose: + print "compiling string with syntax error" + +try: + compile("1+*3", "filename", "exec") +except SyntaxError, detail: + if not detail.filename == "filename": + raise TestFailed, "expected 'filename', got %r" % detail.filename + try: exec 'def f(a = 0, a = 1): pass' raise TestFailed, "duplicate keyword arguments" |