def setUp(self):
FixerTestCase.setUp(self)
- # Need to replace fix_import's isfile and isdir method
+ # Need to replace fix_import's exists method
# so we can check that it's doing the right thing
self.files_checked = []
self.always_exists = True
pass
else:
self.fail("Able to resize readonly memory map")
+ f.close()
del m, f
self.assertEqual(open(TESTFN, "rb").read(), b'a'*mapsize,
"Readonly memory map data file was modified")
"Copy-on-write test data file should not be modified.")
# Ensuring copy-on-write maps cannot be resized
self.assertRaises(TypeError, m.resize, 2*mapsize)
+ f.close()
del m, f
# Ensuring invalid access parameter raises exception
f = open(TESTFN, "rb")
m = mmap.mmap(f.fileno(), mapsize, prot=mmap.PROT_READ)
self.assertRaises(TypeError, m.write, "foo")
-
+ f.close()
def test_error(self):
self.assert_(issubclass(mmap.error, EnvironmentError))