app/tests/app_tests.py
def app(request):
    """Session-wide test Flask app"""

    _app.config['TESTING'] = True
    _app.config['SQLALCHEMY_DATABASE_URI'] = TEST_DATABASE_URI

    # Create app context
    ctx = _app.app_context()
    ctx.push()

    def teardown():
        ctx.pop()
        if os.path.exists(TEST_DB_PATH):
            os.remove(TEST_DB_PATH)

    request.addfinalizer(teardown)
    return _app
Session-wide test Flask app
Session-wide test Flask app
Session - wide test Flask app
def app(request):
    _app.config['TESTING'] = True
    _app.config['SQLALCHEMY_DATABASE_URI'] = TEST_DATABASE_URI
    ctx = _app.app_context()
    ctx.push()
    def teardown():
        ctx.pop()
        if os.path.exists(TEST_DB_PATH):
            os.remove(TEST_DB_PATH)
    request.addfinalizer(teardown)
    return _app
def app ( request ) : _app . config [ 'TESTING' ] = True _app . config [ 'SQLALCHEMY_DATABASE_URI' ] = TEST_DATABASE_URI ctx = _app . app_context ( ) ctx . push ( ) def teardown ( ) : ctx . pop ( ) if os . path . exists ( TEST_DB_PATH ) : os . remove ( TEST_DB_PATH ) request . addfinalizer ( teardown ) return _app
Session-wide test Flask app
Session - wide test Flask app
"""Session-wide test Flask app""" # Create app context
request