diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-08-08 16:43:59 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-08-08 16:43:59 (GMT) |
commit | 0955f29703fed81b9bf47a91314e615454496f67 (patch) | |
tree | cd78c7db19f87cce71875717611ce9c457dcb8d1 | |
parent | 2a5f656d0c93df175cf1ca2fe991927d3fd4a053 (diff) | |
download | cpython-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.
-rw-r--r-- | Lib/test/test_compiler.py | 6 |
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") |