From: Elrond Date: Fri, 10 Jun 2011 19:59:04 +0000 (+0200) Subject: Tests: Kill the whole testing database after all tests X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=12c559447a75fa4b43872ccda544762a331a1bed;p=mediagoblin.git 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. --- 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"