def db(): _db.create_all() yield _db _db.session.remove() _db.drop_all()
def db(): """ Database fixture which creates/drop tables on setup/cleanup Useful for tests that need an empty database (e.g. testing mongo imports) """ _db.create_all() yield _db _db.session.remove() _db.drop_all()