From 0955f29703fed81b9bf47a91314e615454496f67 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sun, 8 Aug 2004 16:43:59 +0000 Subject: 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. --- Lib/test/test_compiler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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") -- cgit v0.12