diff options
| author | Gregory P. Smith <greg@mad-scientist.com> | 2007-08-28 08:05:56 (GMT) |
|---|---|---|
| committer | Gregory P. Smith <greg@mad-scientist.com> | 2007-08-28 08:05:56 (GMT) |
| commit | 3fd22da6129040fdea850bf593e63fc8c333304b (patch) | |
| tree | c7ce98ab685a138c745048f0314c9007b9d99996 /Lib/bsddb/test/test_dbobj.py | |
| parent | a280ca759492360fd7440476f513fa9726d22bff (diff) | |
| download | cpython-3fd22da6129040fdea850bf593e63fc8c333304b.zip cpython-3fd22da6129040fdea850bf593e63fc8c333304b.tar.gz cpython-3fd22da6129040fdea850bf593e63fc8c333304b.tar.bz2 | |
some test suite cleanup, use tempfile.mkdtemp() in setUp and
shutil.rmtree() in tearDown(). add missing tests to the list
in the test_bsddb3 suite.
Diffstat (limited to 'Lib/bsddb/test/test_dbobj.py')
| -rw-r--r-- | Lib/bsddb/test/test_dbobj.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Lib/bsddb/test/test_dbobj.py b/Lib/bsddb/test/test_dbobj.py index f8353f3..22d46bc 100644 --- a/Lib/bsddb/test/test_dbobj.py +++ b/Lib/bsddb/test/test_dbobj.py @@ -1,4 +1,5 @@ +import shutil import sys, os import unittest import glob @@ -16,23 +17,17 @@ except ImportError: class dbobjTestCase(unittest.TestCase): """Verify that dbobj.DB and dbobj.DBEnv work properly""" - db_home = 'db_home' db_name = 'test-dbobj.db' def setUp(self): - homeDir = os.path.join(tempfile.gettempdir(), 'db_home') - self.homeDir = homeDir - try: os.mkdir(homeDir) - except os.error: pass + self.homeDir = tempfile.mkdtemp() def tearDown(self): if hasattr(self, 'db'): del self.db if hasattr(self, 'env'): del self.env - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) + shutil.rmtree(self.homeDir) def test01_both(self): class TestDBEnv(dbobj.DBEnv): pass |
