Example #1
0
def app(request):
    """Session-wide test `Flask` application."""
    settings_override = {
        'TESTING': True,
        'SQLALCHEMY_DATABASE_URI': TEST_DATABASE_URI,
        'SEARCH_INDEX_NAME': TEST_SEARCH_INDEX_NAME
    }

    app = create_app(__name__, settings_override)

    # By default, all tests are run without signals for performance. If a
    # test requires signalling support then it has to require the `signals`
    # fixture.
    deregister_signals()

    # Establish an application context before running the tests.
    ctx = app.app_context()
    ctx.push()

    def teardown():
        ctx.pop()

    request.addfinalizer(teardown)
    return app
Example #2
0
def app(request):
    """Session-wide test `Flask` application."""
    settings_override = {
        'TESTING': True,
        'SQLALCHEMY_DATABASE_URI': TEST_DATABASE_URI,
        'SEARCH_INDEX_NAME': TEST_SEARCH_INDEX_NAME
    }

    app = create_app(__name__, settings_override)

    # By default, all tests are run without signals for performance. If a
    # test requires signalling support then it has to require the `signals`
    # fixture.
    deregister_signals()

    # Establish an application context before running the tests.
    ctx = app.app_context()
    ctx.push()

    def teardown():
        ctx.pop()

    request.addfinalizer(teardown)
    return app
Example #3
0
 def teardown():
     deregister_signals()
Example #4
0
 def teardown():
     deregister_signals()