def setUpClass(cls): switch_engine(test=True) cls.dbs = new_session() create_all(Base)
def load_user(_id): dbs = new_session() user = dbs.query.filter(User.id == _id).first() dbs.close() return user
def setUp(self): self.dbs = new_session()