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()
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()
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()
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()
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()
def teardown(): # Remove the database again teardown_db()
def teardown_method(self): tests.teardown_db()
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()
def teardown(): """Function called by nose after all tests in this module ran""" teardown_db()