summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bsddb185.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2003-05-17 02:54:11 (GMT)
committerSkip Montanaro <skip@pobox.com>2003-05-17 02:54:11 (GMT)
commitab0053aa13951ad00a00c29467cc6b106725630b (patch)
treead0f3c9b5ae9a1be92153919a10285a8bd2bceeb /Lib/test/test_bsddb185.py
parentde9a0d3158df0278d83754740f33276f780cef90 (diff)
downloadcpython-ab0053aa13951ad00a00c29467cc6b106725630b.zip
cpython-ab0053aa13951ad00a00c29467cc6b106725630b.tar.gz
cpython-ab0053aa13951ad00a00c29467cc6b106725630b.tar.bz2
simpler temp dir cleanup
Diffstat (limited to 'Lib/test/test_bsddb185.py')
-rw-r--r--Lib/test/test_bsddb185.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/Lib/test/test_bsddb185.py b/Lib/test/test_bsddb185.py
index ceacf4d..df1ece0 100644
--- a/Lib/test/test_bsddb185.py
+++ b/Lib/test/test_bsddb185.py
@@ -11,6 +11,7 @@ import anydbm
import whichdb
import os
import tempfile
+import shutil
class Bsddb185Tests(unittest.TestCase):
@@ -28,15 +29,12 @@ class Bsddb185Tests(unittest.TestCase):
# Verify that anydbm.open does *not* create a bsddb185 file
tmpdir = tempfile.mkdtemp()
try:
- try:
- dbfile = os.path.join(tmpdir, "foo.db")
- anydbm.open(os.path.splitext(dbfile)[0], "c").close()
- ftype = whichdb.whichdb(dbfile)
- self.assertNotEqual(ftype, "bsddb185")
- finally:
- os.unlink(dbfile)
+ dbfile = os.path.join(tmpdir, "foo.db")
+ anydbm.open(dbfile, "c").close()
+ ftype = whichdb.whichdb(dbfile)
+ self.assertNotEqual(ftype, "bsddb185")
finally:
- os.rmdir(tmpdir)
+ shutil.rmtree(tmpdir)
def test_main():
run_unittest(Bsddb185Tests)