From 23daade028eca9287f7072a6af26871f99088fe9 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 25 Feb 2008 12:39:23 +0000 Subject: Merged revisions 61038,61042-61045,61047,61049-61053,61055-61057 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r61049 | christian.heimes | 2008-02-24 13:26:16 +0100 (Sun, 24 Feb 2008) | 1 line Use PY_FORMAT_SIZE_T instead of z for string formatting. Thanks Neal. ........ r61051 | mark.dickinson | 2008-02-24 19:12:36 +0100 (Sun, 24 Feb 2008) | 2 lines Remove duplicate 'import re' in decimal.py ........ r61052 | neal.norwitz | 2008-02-24 19:47:03 +0100 (Sun, 24 Feb 2008) | 11 lines Create a db_home directory with a unique name so multiple users can run the test simultaneously. The simplest thing I found that worked on both Windows and Unix was to use the PID. It's unique so should be sufficient. This should prevent many of the spurious failures of the automated tests since they run as different users. Also cleanup the directory consistenly in the tearDown methods. It would be nice if someone ensured that the directories are always created with a consistent name. ........ r61057 | christian.heimes | 2008-02-24 23:48:05 +0100 (Sun, 24 Feb 2008) | 2 lines Added dependency rules for Objects/stringlib/*.h stringobject, unicodeobject and the two formatters are rebuild whenever a header files changes ........ --- Lib/bsddb/test/test_misc.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Lib/bsddb/test/test_misc.py') diff --git a/Lib/bsddb/test/test_misc.py b/Lib/bsddb/test/test_misc.py index b7a6710c2b..5b9ab0a61b 100644 --- a/Lib/bsddb/test/test_misc.py +++ b/Lib/bsddb/test/test_misc.py @@ -19,14 +19,17 @@ except ImportError: class MiscTestCase(unittest.TestCase): def setUp(self): self.filename = self.__class__.__name__ + '.db' - self.homeDir = tempfile.mkdtemp() - - def tearDown(self): + homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid()) + self.homeDir = homeDir try: - os.remove(self.filename) + os.mkdir(homeDir) except OSError: pass - shutil.rmtree(self.homeDir) + + def tearDown(self): + from test import test_support + test_support.unlink(self.filename) + test_support.rmtree(self.homeDir) def test01_badpointer(self): dbs = dbshelve.open(self.filename) -- cgit v1.2.1