]> granicus.if.org Git - python/commitdiff
Tell unittest that source files with "badsyntax" in their names should
authorTim Peters <tim.peters@gmail.com>
Sun, 8 Aug 2004 16:43:59 +0000 (16:43 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 8 Aug 2004 16:43:59 +0000 (16:43 +0000)
raise SyntaxError.  test_compiler passes now on WinXP, at least in a
release-build non-O run.

Lib/test/test_compiler.py

index 0e6d1a910d759b6b0031c002b3cb1b87d25d5f83..bc2dd701a80ba56ba6b8dbae6bf7ea28e6a9d80d 100644 (file)
@@ -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")