Skip to content

Commit 6e6ad2e

Browse files
author
Richard Jones
committed
close the databases before test cleanup
1 parent 36ca2a7 commit 6e6ad2e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

test/test_db.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: test_db.py,v 1.44 2002-09-10 03:01:20 richard Exp $
18+
# $Id: test_db.py,v 1.45 2002-09-12 04:21:20 richard Exp $
1919

2020
import unittest, os, shutil, time
2121

@@ -47,6 +47,9 @@ def setupSchema(db, create, module):
4747

4848
class MyTestCase(unittest.TestCase):
4949
def tearDown(self):
50+
self.db.close()
51+
if hasattr(self, 'db2'):
52+
self.db2.close()
5053
if os.path.exists('_test_dir'):
5154
shutil.rmtree('_test_dir')
5255

test/test_mailgw.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# but WITHOUT ANY WARRANTY; without even the implied warranty of
99
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010
#
11-
# $Id: test_mailgw.py,v 1.29 2002-09-10 02:37:28 richard Exp $
11+
# $Id: test_mailgw.py,v 1.30 2002-09-12 04:21:20 richard Exp $
1212

1313
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
1414

@@ -92,6 +92,7 @@ def setUp(self):
9292
def tearDown(self):
9393
if os.path.exists(os.environ['SENDMAILDEBUG']):
9494
os.remove(os.environ['SENDMAILDEBUG'])
95+
self.db.close()
9596
try:
9697
shutil.rmtree(self.dirname)
9798
except OSError, error:

test/test_schema.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: test_schema.py,v 1.10 2002-09-10 03:01:20 richard Exp $
18+
# $Id: test_schema.py,v 1.11 2002-09-12 04:21:21 richard Exp $
1919

2020
import unittest, os, shutil
2121

@@ -47,6 +47,7 @@ def setUp(self):
4747
self.db.clear()
4848

4949
def tearDown(self):
50+
self.db.close()
5051
shutil.rmtree('_test_dir')
5152

5253
def testA_Status(self):

0 commit comments

Comments
 (0)