Commit fe7e5e3b authored by Jim Fulton's avatar Jim Fulton

Use setupstack, rather than the older and duplicative facilities

that were removed from ZODB.tests.util.
parent 7a31b87b
......@@ -15,6 +15,7 @@ import os, unittest
import transaction
import ZODB.FileStorage
import ZODB.tests.util
import zope.testing.setupstack
from ZODB import POSException
from ZODB import DB
......@@ -564,8 +565,9 @@ def test_suite():
FileStorageRecoveryTest, FileStorageNoRestoreRecoveryTest,
SlowFileStorageTest]:
suite.addTest(unittest.makeSuite(klass, "check"))
suite.addTest(doctest.DocTestSuite(setUp=ZODB.tests.util.setUp,
tearDown=ZODB.tests.util.tearDown))
suite.addTest(doctest.DocTestSuite(
setUp=zope.testing.setupstack.setUpDirectory,
tearDown=zope.testing.setupstack.tearDown))
return suite
if __name__=='__main__':
......
......@@ -614,19 +614,8 @@ def is_blob_record():
"""
def setUp(test):
ZODB.tests.util.setUp(test)
def rmtree(path):
for path, dirs, files in os.walk(path, False):
for fname in files:
fname = os.path.join(path, fname)
os.chmod(fname, stat.S_IWUSR)
os.remove(fname)
for dname in dirs:
dname = os.path.join(path, dname)
os.rmdir(dname)
os.rmdir(path)
test.globs['rmtree'] = rmtree
zope.testing.setupstack.setUpDirectory(test)
test.globs['rmtree'] = zope.testing.setupstack.rmtree
def test_suite():
suite = unittest.TestSuite()
......@@ -636,11 +625,11 @@ def test_suite():
"blob_packing.txt", "blob_importexport.txt", "blob_consume.txt",
"blob_tempdir.txt",
setUp=setUp,
tearDown=ZODB.tests.util.tearDown,
tearDown=zope.testing.setupstack.tearDown,
))
suite.addTest(doctest.DocTestSuite(
setUp=setUp,
tearDown=ZODB.tests.util.tearDown,
tearDown=zope.testing.setupstack.tearDown,
checker = renormalizing.RENormalizing([
(re.compile(r'\%(sep)s\%(sep)s' % dict(sep=os.path.sep)), '/'),
(re.compile(r'\%(sep)s' % dict(sep=os.path.sep)), '/'),
......
......@@ -15,16 +15,18 @@
$Id$
"""
import unittest
from zope.testing import doctest, module
from zope.testing import doctest, module, setupstack
def setUp(test):
module.setUp(test, 'ConflictResolution_txt')
setupstack.setUpDirectory(test)
def tearDown(test):
test.globs['db'].close()
test.globs['db1'].close()
test.globs['db2'].close()
module.tearDown(test)
setupstack.tearDown(test)
def test_suite():
return unittest.TestSuite((
......
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