"""conftest. This file gets picked up when running py.test tests: http://pytest.org/latest/writing_plugins.html#conftest """ import application from pricing import api from pricing import config import pytest config.ENVIRONMENT = config.TEST_ENVIRONMENT @pytest.fixture def context(): """Return flask app context, including a mock logger. Returns: AppContext: flask app context, including a mock logger. """ context = application.app.app_context() return context @pytest.fixture def app_context(): """Create an api test app fixture.""" with api.app.app_context(): yield