diff options
author | Tim Peters <tim.peters@gmail.com> | 2006-06-09 04:02:06 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2006-06-09 04:02:06 (GMT) |
commit | 0556e9b119c6ea1068d84dd26763e4862047e808 (patch) | |
tree | 663b6b997ad3668c264eb5667a99babcb7bfbe94 /Lib | |
parent | dbb82f623ff04f004aa97e3a93185a0bdda7ad2a (diff) | |
download | cpython-0556e9b119c6ea1068d84dd26763e4862047e808.zip cpython-0556e9b119c6ea1068d84dd26763e4862047e808.tar.gz cpython-0556e9b119c6ea1068d84dd26763e4862047e808.tar.bz2 |
testUnicodeOpen(): I have no idea why, but making this
test clean up after itself appears to fix the test failures
when test_optparse follows test_file.
test_main(): Get rid of TESTFN no matter what. That's
also enough to fix the mystery failures. Doesn't hurt
to fix them twice :-)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_file.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index e19526a..fe3bb92 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -135,6 +135,7 @@ class OtherFileTests(unittest.TestCase): f = open(unicode(TESTFN), "w") self.assert_(repr(f).startswith("<open file u'" + TESTFN)) f.close() + os.unlink(TESTFN) def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument @@ -313,7 +314,13 @@ class OtherFileTests(unittest.TestCase): def test_main(): - run_unittest(AutoFileTests, OtherFileTests) + # Historically, these tests have sloppy about removing TESTFN. So get + # rid of it no matter what. + try: + run_unittest(AutoFileTests, OtherFileTests) + finally: + if os.path.exists(TESTFN): + os.unlink(TESTFN) if __name__ == '__main__': test_main() |