Commit 42f71de0 authored by Jeremy Hylton's avatar Jeremy Hylton

Remove dependency on StorageTestBase setUp() and tearDown().

parent c0f1cce5
...@@ -10,16 +10,13 @@ import ZODB, ZODB.FileStorage ...@@ -10,16 +10,13 @@ import ZODB, ZODB.FileStorage
from StorageTestBase import StorageTestBase from StorageTestBase import StorageTestBase
class FileStorageCorruptTests(StorageTestBase): class FileStorageCorruptTests(StorageTestBase):
__super_setUp = StorageTestBase.setUp
__super_tearDown = StorageTestBase.tearDown
def setUp(self): def setUp(self):
self.__super_setUp()
self.path = tempfile.mktemp() self.path = tempfile.mktemp()
self._storage = ZODB.FileStorage.FileStorage(self.path, create=1) self._storage = ZODB.FileStorage.FileStorage(self.path, create=1)
def tearDown(self): def tearDown(self):
self.__super_tearDown() self._storage.close()
for ext in '', '.old', '.tmp', '.lock', '.index': for ext in '', '.old', '.tmp', '.lock', '.index':
path = self.path + ext path = self.path + ext
if os.path.exists(path): if os.path.exists(path):
......
...@@ -11,9 +11,11 @@ class DemoStorageTests(StorageTestBase.StorageTestBase, ...@@ -11,9 +11,11 @@ class DemoStorageTests(StorageTestBase.StorageTestBase,
): ):
def setUp(self): def setUp(self):
StorageTestBase.StorageTestBase.setUp(self)
self._storage = ZODB.DemoStorage.DemoStorage() self._storage = ZODB.DemoStorage.DemoStorage()
def tearDown(self):
self._storage.close()
def test_suite(): def test_suite():
suite = unittest.makeSuite(DemoStorageTests, 'check') suite = unittest.makeSuite(DemoStorageTests, 'check')
return suite return suite
......
...@@ -9,9 +9,11 @@ class MappingStorageTests(StorageTestBase.StorageTestBase, ...@@ -9,9 +9,11 @@ class MappingStorageTests(StorageTestBase.StorageTestBase,
): ):
def setUp(self): def setUp(self):
StorageTestBase.StorageTestBase.setUp(self)
self._storage = ZODB.MappingStorage.MappingStorage() self._storage = ZODB.MappingStorage.MappingStorage()
def tearDown(self):
self._storage.close()
def test_suite(): def test_suite():
suite = unittest.makeSuite(MappingStorageTests, 'check') suite = unittest.makeSuite(MappingStorageTests, 'check')
return suite return suite
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment