mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Remove the test file before writing it in case there is no write permission.
This might help fix some of the failures on Windows box(es). It doesn't hurt either way and ensure the tests are a little more self contained (ie have less assumptions).
This commit is contained in:
parent
60a819d681
commit
36a59b4a08
4 changed files with 7 additions and 5 deletions
|
@ -163,6 +163,7 @@ class BaseTest(unittest.TestCase):
|
|||
a = array.array(self.typecode, 2*self.example)
|
||||
self.assertRaises(TypeError, a.tofile)
|
||||
self.assertRaises(TypeError, a.tofile, cStringIO.StringIO())
|
||||
test_support.unlink(test_support.TESTFN)
|
||||
f = open(test_support.TESTFN, 'wb')
|
||||
try:
|
||||
a.tofile(f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue