예제 #1
0
    def _create_temp_test_db(self):
        try:
            db.reflect()
            db.drop_all()
        except SQLAlchemyError:
            pass

        db.create_all()

        db.session.commit()
        db.session.flush()
예제 #2
0
    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()