Fixed #19: now uses pytest as a testing framework

merge-requests/154/head
Eliot Berriot 2017-06-26 19:01:15 +02:00
rodzic e7c8cad613
commit 4f15d3d28d
5 zmienionych plików z 12 dodań i 6 usunięć

Wyświetl plik

@ -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

5
api/pytest.ini 100644
Wyświetl plik

@ -0,0 +1,5 @@
[pytest]
DJANGO_SETTINGS_MODULE=config.settings.test
# -- recommended but optional:
python_files = tests.py test_*.py *_tests.py

Wyświetl plik

@ -5,3 +5,7 @@
flake8==2.5.0
model-mommy==1.3.2
tox==2.7.0
pytest
pytest-django
pytest-sugar
pytest-xdist

Wyświetl plik

@ -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 "$@"

Wyświetl plik

@ -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