aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/tools.py
diff options
context:
space:
mode:
authorBrett Smith <brettcsmith@brettcsmith.org>2012-07-08 11:00:36 -0400
committerBrett Smith <brettcsmith@brettcsmith.org>2012-07-08 11:00:36 -0400
commit9c7688667e9a5e96fbf54900976834b4ecf2b033 (patch)
tree63bb355c0fb1c9e368d34523c9b7becd5156a7fa /mediagoblin/tests/tools.py
parent16b8e3afd89d2f19d95e7623cde78ad1afb34f0e (diff)
downloadmediagoblin-9c7688667e9a5e96fbf54900976834b4ecf2b033.tar.lz
mediagoblin-9c7688667e9a5e96fbf54900976834b4ecf2b033.tar.xz
mediagoblin-9c7688667e9a5e96fbf54900976834b4ecf2b033.zip
Drop our scoped session sooner to prevent SQLAlchemy re-binding warnings.
Diffstat (limited to 'mediagoblin/tests/tools.py')
-rw-r--r--mediagoblin/tests/tools.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mediagoblin/tests/tools.py b/mediagoblin/tests/tools.py
index 5b4e3746..bf40ea8b 100644
--- a/mediagoblin/tests/tools.py
+++ b/mediagoblin/tests/tools.py
@@ -116,6 +116,9 @@ def get_test_app(dump_old_app=True):
if MGOBLIN_APP and not dump_old_app:
return MGOBLIN_APP
+ Session.rollback()
+ Session.remove()
+
# Remove and reinstall user_dev directories
if os.path.exists(TEST_USER_DEV):
shutil.rmtree(TEST_USER_DEV)
@@ -135,9 +138,6 @@ def get_test_app(dump_old_app=True):
test_app = loadapp(
'config:' + TEST_SERVER_CONFIG)
- Session.rollback()
- Session.remove()
-
# Re-setup celery
setup_celery_app(app_config, global_config)