diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 577d8b7997480e2b780c543d9e533aaeed50d6c6..74bc0f7b069d825d5259dde1c41f3df4300df8e4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,8 +9,7 @@ test_api: - cd api - pip install -r requirements/test.txt script: - - export DJANGO_SETTINGS_MODULE=config.settings.test - - python manage.py test + - pytest tags: - docker diff --git a/api/pytest.ini b/api/pytest.ini new file mode 100644 index 0000000000000000000000000000000000000000..4ab907403097c796663f02d6a878ccd197970a23 --- /dev/null +++ b/api/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +DJANGO_SETTINGS_MODULE=config.settings.test + +# -- recommended but optional: +python_files = tests.py test_*.py *_tests.py diff --git a/api/requirements/test.txt b/api/requirements/test.txt index 93509c573f14a0699b0c2125f7824c7e418fa797..a26cf5bdbb1a8b60209fb7632c9acf3b3f9c0b08 100644 --- a/api/requirements/test.txt +++ b/api/requirements/test.txt @@ -5,3 +5,7 @@ flake8==2.5.0 model-mommy==1.3.2 tox==2.7.0 +pytest +pytest-django +pytest-sugar +pytest-xdist diff --git a/api/runtests b/api/runtests index bd8db7a8465f10f906fd006eb5399c73c6166758..48e7b82679e6cab413f4d435cfc0b8f794019bb0 100755 --- a/api/runtests +++ b/api/runtests @@ -2,4 +2,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -docker-compose -f $DIR/test.yml run test python manage.py test "$@" +docker-compose -f $DIR/test.yml run test pytest "$@" diff --git a/api/test.yml b/api/test.yml index dc50a9b545d75382531f2684de6cb7ed3925be78..6215e27de0a6e237d119f6a0a3fa7eff4ae0dd7e 100644 --- a/api/test.yml +++ b/api/test.yml @@ -1,8 +1,6 @@ test: dockerfile: docker/Dockerfile.test build: . - command: python manage.py test + command: pytest volumes: - .:/app - environment: - - DJANGO_SETTINGS_MODULE=config.settings.test