mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-01 20:10:16 -04:00
Merge pull request #1864 from alphagov/pytest-env
Automatically set environment vars before tests
This commit is contained in:
@@ -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"
|
||||
11
pytest.ini
Normal file
11
pytest.ini
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user