def __init__(self): threading.Thread.__init__(self) self.srv = make_server('127.0.0.2', FLASK_PORT, app) with app.app_context(): db.drop_all() db.create_all() db.session.commit() self.ctx = app.app_context() self.ctx.push()
def __init__(self, db_path=None): threading.Thread.__init__(self) # If we've provided a database file path, # set it up in the app's config if db_path is not None: set_db_path(db_path) self.srv = make_server('127.0.0.1', FLASK_PORT, app) self.ctx = app.app_context() self.ctx.push()
def __init__(self): threading.Thread.__init__(self) self.srv = make_server('127.0.0.1', FLASK_TEST_PORT, app) self.ctx = app.app_context() self.ctx.push()