summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compiler.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-03-01 21:11:49 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-03-01 21:11:49 (GMT)
commit15bfc3b082a0f62d45dd5ab15e05243dc57e2692 (patch)
treed0715867ed0488579c55d9a58888f37f09eea19b /Lib/test/test_compiler.py
parent20e192b6a636f0f7a9d7cf85c6b30e64dc6c7bc6 (diff)
downloadcpython-15bfc3b082a0f62d45dd5ab15e05243dc57e2692.zip
cpython-15bfc3b082a0f62d45dd5ab15e05243dc57e2692.tar.gz
cpython-15bfc3b082a0f62d45dd5ab15e05243dc57e2692.tar.bz2
Make failures in test cases print failing source file.
Diffstat (limited to 'Lib/test/test_compiler.py')
-rw-r--r--Lib/test/test_compiler.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py
index c328d71..f58e6e5 100644
--- a/Lib/test/test_compiler.py
+++ b/Lib/test/test_compiler.py
@@ -32,7 +32,11 @@ class CompilerTest(unittest.TestCase):
self.assertRaises(SyntaxError, compiler.compile,
buf, basename, "exec")
else:
- compiler.compile(buf, basename, "exec")
+ try:
+ compiler.compile(buf, basename, "exec")
+ except Exception, e:
+ e.args[0] += "[in file %s]" % basename
+ raise
def testNewClassSyntax(self):
compiler.compile("class foo():pass\n\n","<string>","exec")