diff --git a/.gitignore b/.gitignore index 238fb3a200c..6a67c6eb289 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,6 @@ docs/_build/ docs/locale/ node_modules/ tests/coverage_html/ -tests/.coverage +tests/.coverage* build/ tests/report/ diff --git a/docs/internals/contributing/writing-code/unit-tests.txt b/docs/internals/contributing/writing-code/unit-tests.txt index 5d408513a49..6b63e32180c 100644 --- a/docs/internals/contributing/writing-code/unit-tests.txt +++ b/docs/internals/contributing/writing-code/unit-tests.txt @@ -337,14 +337,19 @@ Contributors are encouraged to run coverage on the test suite to identify areas that need additional tests. The coverage tool installation and use is described in :ref:`testing code coverage`. -Coverage should be run in a single process to obtain accurate statistics. To -run coverage on the Django test suite using the standard test settings: +To run coverage on the Django test suite using the standard test settings: .. console:: - $ coverage run ./runtests.py --settings=test_sqlite --parallel=1 + $ coverage run ./runtests.py --settings=test_sqlite -After running coverage, generate the html report by running: +After running coverage, combine all coverage statistics by running: + +.. console:: + + $ coverage combine + +After that generate the html report by running: .. console:: diff --git a/tests/.coveragerc b/tests/.coveragerc index e519f062594..822e6846a91 100644 --- a/tests/.coveragerc +++ b/tests/.coveragerc @@ -1,5 +1,7 @@ [run] branch = True +concurrency = multiprocessing,thread +data_file = .coverages/.coverage omit = */django/utils/autoreload.py source = django