From 12c559447a75fa4b43872ccda544762a331a1bed Mon Sep 17 00:00:00 2001 From: Elrond Date: Fri, 10 Jun 2011 21:59:04 +0200 Subject: [PATCH] Tests: Kill the whole testing database after all tests nose allows setup and teardown functions at the package level. So use this to drop the complete database after all tests have finished. --- mediagoblin/tests/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mediagoblin/tests/__init__.py b/mediagoblin/tests/__init__.py index c129cbf8..46c7fd69 100644 --- a/mediagoblin/tests/__init__.py +++ b/mediagoblin/tests/__init__.py @@ -13,3 +13,14 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . + +from .. import globals + + +def setup_package(): + pass + +def teardown_package(): + print "Killing db ..." + globals.db_connection.drop_database(globals.database.name) + print "... done"