mirror of
https://github.com/pretix/pretix.git
synced 2026-09-14 16:24:43 +00:00
Added pytest-rerunfailures
This commit is contained in:
+2
-2
@@ -20,12 +20,12 @@ if [ "$1" == "tests" ]; then
|
|||||||
cd src
|
cd src
|
||||||
python manage.py check
|
python manage.py check
|
||||||
make all compress
|
make all compress
|
||||||
coverage run -m py.test tests && coverage report
|
coverage run -m py.test --rerun 5 tests && coverage report
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "tests-cov" ]; then
|
if [ "$1" == "tests-cov" ]; then
|
||||||
pip3 install -r src/requirements.txt -Ur src/requirements/dev.txt -r src/requirements/py34.txt
|
pip3 install -r src/requirements.txt -Ur src/requirements/dev.txt -r src/requirements/py34.txt
|
||||||
cd src
|
cd src
|
||||||
python manage.py check
|
python manage.py check
|
||||||
make all compress
|
make all compress
|
||||||
coverage run -m py.test tests && coveralls
|
coverage run -m py.test --rerun 5 tests && coveralls
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -92,11 +92,14 @@ Before you check in your code into git, always run the static checkers and unit
|
|||||||
python manage.py check
|
python manage.py check
|
||||||
py.test
|
py.test
|
||||||
|
|
||||||
If you have multiple CPU cores and want to speed up the test suite, you can install the python
|
.. note:: If you have multiple CPU cores and want to speed up the test suite, you can install the python
|
||||||
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.
|
||||||
|
|
||||||
It is therefore a good idea to put this command into your git hook ``.git/hooks/pre-commit``,
|
.. 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``,
|
||||||
for example::
|
for example::
|
||||||
|
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|||||||
@@ -11,3 +11,4 @@ pytest==2.9.*
|
|||||||
pytest-django
|
pytest-django
|
||||||
isort
|
isort
|
||||||
pytest-mock
|
pytest-mock
|
||||||
|
pytest-rerunfailures
|
||||||
|
|||||||
Reference in New Issue
Block a user