build(test): utilise pytest

pull/49/head
Vincent Adolphe 2019-03-19 10:00:29 +01:00
Parent 7e98cb9cf6
révision 2ab899ee1c
3 fichiers modifiés avec 12 ajouts et 3 suppressions

2
.gitignore externe
Voir le fichier

@ -14,5 +14,7 @@ uploads/*
TAGS
tmp/*
build/*
.coverage
htmlcov
.ropeproject
backups

Voir le fichier

@ -17,10 +17,9 @@ help: ## affiche cette aide
# dev
serve:
$(PYTHON) manage.py runserver $(DJANGO_LISTEN)
test: ### lance les tests de l'application via pytest
$(PYTHON) -m pytest -m 'not slow' --cov=gaby --cov-report=html --cov-report=term-missing gaby
test:
@echo "coverage test"
$(PYTHON) -Wd manage.py test $(TEST_SUITE)
lint: ### vérifie la syntaxe et le code python
which black > /dev/null && black --check gaby ; true

8
pytest.ini Normal file
Voir le fichier

@ -0,0 +1,8 @@
[pytest]
DJANGO_SETTINGS_MODULE = gaby.settings.test
python_files = tests.py test_*.py *_tests.py
filterwarnings =
ignore::django.utils.deprecation.RemovedInDjango30Warning
markers =
wip: mark a test work in progress, to help designing a test
slow: mark a test 'slow'