示例#1
0
def frontend_app():
    """Set up global front-end app for functional tests

    Initialized once per test-run
    """
    app = create_frontend_app(config.TESTING_CONF_PATH)
    with app.app_context():
        setup_app(app)
        setup_db()
        yield app
        teardown_db()
示例#2
0
def db_schema(app):
    """Creates clean database schema and drops it on teardown

    Note, that this is a session scoped fixture, it will be executed only once
    and shared among all tests. Use `db` fixture to get clean database before
    each test.
    """
    with app.app_context():
        setup_db()
        yield model.db.session
        teardown_db()
示例#3
0
def db(app):
    """Creates clean database schema and drops it on teardown

    Note, that this is a session scoped fixture, it will be executed only once
    and shared among all tests. Use `db_session` fixture to get clean database
    before each test.
    """

    setup_db(app)
    yield database.db
    teardown_db()
示例#4
0
def database(application):
    """Creates clean database schema and drops it on teardown

    Note, that this is a session scoped fixture, it will be executed only once
    and shared among all tests. Use `db` fixture to get clean database before
    each test.
    """
    assert isinstance(application, App)

    setup_db(application)
    yield db
    teardown_db()
示例#5
0
def db(app):
    """Creates clean database schema and drops it on teardown

    Note, that this is a session scoped fixture, it will be executed only once
    and shared among all tests. Use `db_session` fixture to get clean database
    before each test.
    """
    assert isinstance(app, SkyLines)

    setup_db(app)
    yield database.db
    teardown_db()
示例#6
0
def teardown():
    # Remove the database again
    teardown_db()
示例#7
0
 def teardown_method(self):
     tests.teardown_db()
示例#8
0
def db(app):
    """Creates clean database schema and drops it on teardown"""
    assert isinstance(app, URLShortenerApp)
    setup_db(app)
    yield database.db
    teardown_db()
def teardown_db():
	global dbmanager
	dbmanager = None
	tests.teardown_db()
示例#10
0
def teardown():
    """Function called by nose after all tests in this module ran"""
    teardown_db()