Tests: Kill the whole testing database after all tests
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Fri, 10 Jun 2011 19:59:04 +0000 (21:59 +0200)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Fri, 10 Jun 2011 19:59:04 +0000 (21:59 +0200)
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

index c129cbf867f69dae978186056728b4a8c123a7df..46c7fd69eca7c48b9f105992f60ce7f25cec05a4 100644 (file)
 #
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from .. import globals
+
+
+def setup_package():
+    pass
+
+def teardown_package():
+    print "Killing db ..."
+    globals.db_connection.drop_database(globals.database.name)
+    print "... done"