From 2bea38fd3b346105cd0a6f3389ccdd0e8c663974 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 12 Sep 2002 04:21:21 +0000 Subject: [PATCH] close the databases before test cleanup git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1148 57a73879-2fb5-44c3-a270-3262357dd7e2 --- test/test_db.py | 5 ++++- test/test_mailgw.py | 3 ++- test/test_schema.py | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/test_db.py b/test/test_db.py index 4edb232..a00a9d3 100644 --- a/test/test_db.py +++ b/test/test_db.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_db.py,v 1.44 2002-09-10 03:01:20 richard Exp $ +# $Id: test_db.py,v 1.45 2002-09-12 04:21:20 richard Exp $ import unittest, os, shutil, time @@ -47,6 +47,9 @@ def setupSchema(db, create, module): class MyTestCase(unittest.TestCase): def tearDown(self): + self.db.close() + if hasattr(self, 'db2'): + self.db2.close() if os.path.exists('_test_dir'): shutil.rmtree('_test_dir') diff --git a/test/test_mailgw.py b/test/test_mailgw.py index 26e4195..650133f 100644 --- a/test/test_mailgw.py +++ b/test/test_mailgw.py @@ -8,7 +8,7 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# $Id: test_mailgw.py,v 1.29 2002-09-10 02:37:28 richard Exp $ +# $Id: test_mailgw.py,v 1.30 2002-09-12 04:21:20 richard Exp $ import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib @@ -92,6 +92,7 @@ class MailgwTestCase(unittest.TestCase, DiffHelper): def tearDown(self): if os.path.exists(os.environ['SENDMAILDEBUG']): os.remove(os.environ['SENDMAILDEBUG']) + self.db.close() try: shutil.rmtree(self.dirname) except OSError, error: diff --git a/test/test_schema.py b/test/test_schema.py index 44aea25..9ad53c8 100644 --- a/test/test_schema.py +++ b/test/test_schema.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_schema.py,v 1.10 2002-09-10 03:01:20 richard Exp $ +# $Id: test_schema.py,v 1.11 2002-09-12 04:21:21 richard Exp $ import unittest, os, shutil @@ -47,6 +47,7 @@ class SchemaTestCase(unittest.TestCase): self.db.clear() def tearDown(self): + self.db.close() shutil.rmtree('_test_dir') def testA_Status(self): -- 2.30.2