Drop our scoped session sooner to prevent SQLAlchemy re-binding warnings.

This commit is contained in:
Brett Smith 2012-07-08 11:00:36 -04:00
parent 16b8e3afd8
commit 9c7688667e

View File

@ -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)