def tearDown(self): with db.cursor() as cur: drop_db = "drop database if exists %s" % (app.config["DBNAME"]) cur.execute(drop_db) db.close()
def teardown_request(exception): if exception is not None: db.rollback() db.close()