Merge "Fix database clear when table does not exist"

This commit is contained in:
Jenkins 2012-10-25 17:48:25 +00:00 committed by Gerrit Code Review
commit 84f74d1bff

View File

@ -88,7 +88,10 @@ def clear_db(base=BASE):
global _ENGINE
assert _ENGINE
for table in reversed(base.metadata.sorted_tables):
_ENGINE.execute(table.delete())
try:
_ENGINE.execute(table.delete())
except Exception as e:
LOG.info("Unable to delete table. %s.", e)
def get_session(autocommit=True, expire_on_commit=False):