diff --git a/environment_test.sh b/environment_test.sh deleted file mode 100644 index 18f0add28..000000000 --- a/environment_test.sh +++ /dev/null @@ -1,8 +0,0 @@ -export NOTIFY_ENVIRONMENT='test' -export ADMIN_CLIENT_SECRET='dev-notify-secret-key' -export API_HOST_NAME='' -export DANGEROUS_SALT='dev-notify-salt' -export SECRET_KEY='dev-notify-secret-key' -export DESKPRO_API_HOST="" -export DESKPRO_API_KEY="" -export STATSD_PREFIX="stats-prefix" diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 000000000..6a7eed81e --- /dev/null +++ b/pytest.ini @@ -0,0 +1,11 @@ +[pytest] +testpaths = tests +env = + NOTIFY_ENVIRONMENT=test + ADMIN_CLIENT_SECRET=dev-notify-secret-key + API_HOST_NAME=test + DANGEROUS_SALT=dev-notify-salt + SECRET_KEY=dev-notify-secret-key + DESKPRO_API_HOST=test + DESKPRO_API_KEY=test + STATSD_PREFIX=stats-prefix diff --git a/requirements_for_test.txt b/requirements_for_test.txt index f4ba9ba05..ebd78061a 100644 --- a/requirements_for_test.txt +++ b/requirements_for_test.txt @@ -1,5 +1,6 @@ -r requirements.txt pytest==3.4.0 +pytest-env==0.6.2 pytest-mock==1.6.3 pytest-cov==2.5.1 pytest-xdist==1.22.0 diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 52a884a3d..e2aeae9c6 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -5,12 +5,8 @@ # NOTE: This script expects to be run from the project root with # ./scripts/run_tests.sh -# Use default environment vars for localhost if not already set - set -o pipefail -source environment_test.sh - function display_result { RESULT=$1 EXIT_STATUS=$2