Skip to content

Commit a994333

Browse files
author
neal.norwitz
committed
Remove the files/dirs after closing the DB so the tests work on Windows.
Patch from Trent Nelson. Also simplified removing a file by using test_support. git-svn-id: http://svn.python.org/projects/python/trunk@61241 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent cdaff24 commit a994333

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

Lib/bsddb/test/test_dbshelve.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ def setUp(self):
4040

4141
def tearDown(self):
4242
self.do_close()
43-
try:
44-
os.remove(self.filename)
45-
except os.error:
46-
pass
43+
test_support.unlink(self.filename)
4744

4845
def mk(self, key):
4946
"""Turn key into an appropriate key type for this db"""
@@ -267,8 +264,8 @@ def do_close(self):
267264

268265

269266
def tearDown(self):
270-
test_support.rmtree(self.homeDir)
271267
self.do_close()
268+
test_support.rmtree(self.homeDir)
272269

273270

274271
class EnvBTreeShelveTestCase(BasicEnvShelveTestCase):

Lib/bsddb/test/test_thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ def setUp(self):
7373
self.d.open(self.filename, self.dbtype, self.dbopenflags|db.DB_CREATE)
7474

7575
def tearDown(self):
76-
test_support.rmtree(self.homeDir)
7776
self.d.close()
7877
self.env.close()
78+
test_support.rmtree(self.homeDir)
7979

8080
def setEnvOpts(self):
8181
pass

0 commit comments

Comments
 (0)