summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-08-08 16:43:59 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-08-08 16:43:59 (GMT)
commit0955f29703fed81b9bf47a91314e615454496f67 (patch)
treecd78c7db19f87cce71875717611ce9c457dcb8d1 /Lib
parent2a5f656d0c93df175cf1ca2fe991927d3fd4a053 (diff)
downloadcpython-0955f29703fed81b9bf47a91314e615454496f67.zip
cpython-0955f29703fed81b9bf47a91314e615454496f67.tar.gz
cpython-0955f29703fed81b9bf47a91314e615454496f67.tar.bz2
Tell unittest that source files with "badsyntax" in their names should
raise SyntaxError. test_compiler passes now on WinXP, at least in a release-build non-O run.
Diffstat (limited to 'Lib')
-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 0e6d1a9..bc2dd70 100644
--- a/Lib/test/test_compiler.py
+++ b/Lib/test/test_compiler.py
@@ -24,7 +24,11 @@ class CompilerTest(unittest.TestCase):
f = open(path)
buf = f.read()
f.close()
- compiler.compile(buf, basename, "exec")
+ if "badsyntax" in basename:
+ self.assertRaises(SyntaxError, compiler.compile,
+ buf, basename, "exec")
+ else:
+ compiler.compile(buf, basename, "exec")
def test_main():
test.test_support.requires("compiler")