diff --git a/Makefile b/Makefile index b96a292a2..ebf56145a 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,7 @@ test-with-docker: prepare-docker-build-image create-docker-test-db ## Run tests --link "${DOCKER_CONTAINER_PREFIX}-db:postgres" \ -e UID=$(shell id -u) \ -e GID=$(shell id -g) \ - -e TEST_DATABASE=postgresql://postgres:postgres@postgres/test_notification_api \ + -e SQLALCHEMY_DATABASE_URI=postgresql://postgres:postgres@postgres/test_notification_api \ -e GIT_COMMIT=${GIT_COMMIT} \ -e BUILD_NUMBER=${BUILD_NUMBER} \ -e BUILD_URL=${BUILD_URL} \ diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 000000000..a76815501 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,20 @@ +[pytest] +testpaths = tests +env = + D:SQLALCHEMY_DATABASE_URI=postgresql://@localhost/test_notification_api + SECRET_KEY=secret-key + DANGEROUS_SALT=dangerous-salt + NOTIFY_ENVIRONMENT=test + ADMIN_CLIENT_SECRET=dev-notify-secret-key + ADMIN_BASE_URL=http://localhost:6012 + FROM_NUMBER=from_number + MMG_URL=https://api.mmg.co.uk/json/api.php + MMG_API_KEY=mmg-secret-key + LOADTESTING_API_KEY=loadtesting + FIRETEXT_API_KEY=Firetext + STATSD_PREFIX=stats-prefix + NOTIFICATION_QUEUE_PREFIX=testing + REDIS_URL=redis://localhost:6379/0 + FLASK_APP=application.py + FLASK_DEBUG=1 + WERKZEUG_DEBUG_PIN=off diff --git a/requirements_for_test.txt b/requirements_for_test.txt index 71a8c290d..1e62201eb 100644 --- a/requirements_for_test.txt +++ b/requirements_for_test.txt @@ -1,6 +1,7 @@ -r requirements.txt flake8==3.5.0 pytest==3.4.0 +pytest-env==0.6.2 pytest-mock==1.6.3 pytest-cov==2.5.1 pytest-xdist==1.22.0