py.test: rerun and print warnings by default

This commit is contained in:
Raphael Michel
2016-09-27 11:06:58 +02:00
parent 3bc2ddf79d
commit b6a34975a9
3 changed files with 2 additions and 3 deletions

View File

@@ -96,9 +96,6 @@ Before you check in your code into git, always run the static checkers and unit
package ``pytest-xdist`` using ``pip install pytest-xdist`` and then run ``py.test -n NUM`` with package ``pytest-xdist`` using ``pip install pytest-xdist`` and then run ``py.test -n NUM`` with
``NUM`` being the number of threads you want to use. ``NUM`` being the number of threads you want to use.
.. note:: We currently have some flaky tests that we haven't yet been able to debug. If you just run
``py.test --rerun 5`` they'll be rerun and only reported as failures if they fail repeatedly.
It is a good idea to put this command into your git hook ``.git/hooks/pre-commit``, It is a good idea to put this command into your git hook ``.git/hooks/pre-commit``,
for example:: for example::

View File

@@ -1,2 +1,3 @@
[pytest] [pytest]
DJANGO_SETTINGS_MODULE=tests.settings DJANGO_SETTINGS_MODULE=tests.settings
addopts =--rerun 3 -rw

View File

@@ -12,3 +12,4 @@ pytest-django
isort isort
pytest-mock pytest-mock
pytest-rerunfailures pytest-rerunfailures
pytest-warnings