Browse Source

build(test): utilise pytest

pull/49/head
Vincent Adolphe 3 years ago
parent
commit
2ab899ee1c
  1. 2
      .gitignore
  2. 5
      Makefile
  3. 8
      pytest.ini

2
.gitignore vendored

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

5
Makefile

@ -17,10 +17,9 @@ help: ## affiche cette aide @@ -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

@ -0,0 +1,8 @@ @@ -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'
Loading…
Cancel
Save
Map all the world