def _create_temp_test_db(self): try: db.reflect() db.drop_all() except SQLAlchemyError: pass db.create_all() db.session.commit() db.session.flush()
def master_test_teardown(self): # This is necessary to commit any pending transactions, which will make Postgres lock on DROP table queries db.session.commit() db.drop_all()