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(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 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 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 setup(): # Setup the database setup_db() db.session.add(TestTable(name='John Doe', uni='Jane and John Doe')) db.session.commit()
def setup_method(self): tests.setup_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 setUp(self): setup_db(self)
def setup_db(): global dbmanager tests.setup_db() dbmanager = tests.dbmanager qbicpwresetd.db_manager = tests.dbmanager
def setup(): """Function called by nose on module load""" setup_db()
def setup_db(): global dbmanager tests.setup_db() dbmanager = tests.dbmanager