mirror of
https://github.com/python/cpython.git
synced 2025-12-01 23:32:16 +00:00
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.
This commit is contained in:
parent
2a5f656d0c
commit
0955f29703
1 changed files with 5 additions and 1 deletions
|
|
@ -24,6 +24,10 @@ class CompilerTest(unittest.TestCase):
|
||||||
f = open(path)
|
f = open(path)
|
||||||
buf = f.read()
|
buf = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
|
if "badsyntax" in basename:
|
||||||
|
self.assertRaises(SyntaxError, compiler.compile,
|
||||||
|
buf, basename, "exec")
|
||||||
|
else:
|
||||||
compiler.compile(buf, basename, "exec")
|
compiler.compile(buf, basename, "exec")
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue