def test_db(test_client): # Create the database and the database table db.create_all() yield db # this is where the testing happens! # anything after yield is teardown code db.session.rollback() db.session.remove() db.drop_all()
def drop(env): "Drops database tables" init_for(env) if prompt_bool("Are you sure you want to lose all your data?"): db.drop_all()
def tearDown(self): db.session.remove() db.drop_all()