Merge "Fix database clear when table does not exist"
This commit is contained in:
commit
84f74d1bff
@ -88,7 +88,10 @@ def clear_db(base=BASE):
|
|||||||
global _ENGINE
|
global _ENGINE
|
||||||
assert _ENGINE
|
assert _ENGINE
|
||||||
for table in reversed(base.metadata.sorted_tables):
|
for table in reversed(base.metadata.sorted_tables):
|
||||||
|
try:
|
||||||
_ENGINE.execute(table.delete())
|
_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):
|
def get_session(autocommit=True, expire_on_commit=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user