diff options
author | Paolo Melchiorre <paolo@melchiorre.org> | 2023-02-11 09:43:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-11 09:43:26 +0100 |
commit | 69352d85fa8412865db9e0c7f177b333c0eac3e2 (patch) | |
tree | 2c626652cdced6c9f4b7349953286bf45c8a0e37 | |
parent | b6ed389eec3e72d50301f456d711496331abd7b3 (diff) | |
download | django-69352d85fa8412865db9e0c7f177b333c0eac3e2.tar.gz |
Fixed #33213 -- Doc'd testing code coverage in parallel and used it.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | docs/internals/contributing/writing-code/unit-tests.txt | 13 | ||||
-rw-r--r-- | tests/.coveragerc | 2 |
3 files changed, 12 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore index 238fb3a200..6a67c6eb28 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 1da9dad97a..b547a28049 100644 --- a/docs/internals/contributing/writing-code/unit-tests.txt +++ b/docs/internals/contributing/writing-code/unit-tests.txt @@ -356,14 +356,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<topics-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 e519f06259..258c82e8ee 100644 --- a/tests/.coveragerc +++ b/tests/.coveragerc @@ -1,5 +1,7 @@ [run] branch = True +concurrency = multiprocessing +data_file = .coverages/.coverage omit = */django/utils/autoreload.py source = django |