Example project demonstrating using Django’s test runner with Coverage.py

Example project demonstrating using Django’s test runner with Coverage.py

Set up with:

python -m venv --prompt . venv
source venv/bin/activate
python -m pip install -r requirements.txt

Run tests in parallel mode with coverage with this combination of commands:

coverage erase && coverage run manage.py test --parallel 2 && coverage combine && coverage report

You can also omit the number 2 to use as many test processes as there are CPU cores.
But on Django < 4.0 this will trigger a warning:

 

 

 

To finish reading, please visit source site