Close session after upgrade. Fixes a filelock issue in windows tests.

This commit is contained in:
Tomas Groth 2015-01-14 11:56:18 +01:00
parent 38db55a37c
commit cffad28749

View File

@ -156,7 +156,10 @@ def upgrade_db(url, upgrade):
except (SQLAlchemyError, DBAPIError): except (SQLAlchemyError, DBAPIError):
version_meta = Metadata.populate(key='version', value=int(upgrade.__version__)) version_meta = Metadata.populate(key='version', value=int(upgrade.__version__))
session.commit() session.commit()
return int(version_meta.value), upgrade.__version__ upgrade_version = upgrade.__version__
version_meta = int(version_meta.value)
session.close()
return version_meta, upgrade_version
def delete_database(plugin_name, db_file_name=None): def delete_database(plugin_name, db_file_name=None):