summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Gibbons <1726961+marcgibbons@users.noreply.github.com>2023-04-27 14:02:55 -0600
committerGitHub <noreply@github.com>2023-04-27 17:02:55 -0300
commit070cbac0dbf6a09b55aad322137ab168b75bf56b (patch)
treec9f4273cbd9ac710c3fcc47aa4e449f313eadec5
parent5c456a879300e5f51010d3f6aa7449302413efed (diff)
downloaddjango-070cbac0dbf6a09b55aad322137ab168b75bf56b.tar.gz
Restored multiprocessing concurrency on coverage.py settings
* Revert "Reverted "Fixed #33213 -- Doc'd testing code coverage in parallel and used it."" This reverts commit 78da5ca0c1f2ab3201f8f6cd629e80d805ea023d. * Restored coverage multiprocess concurrency with threads Investigating https://github.com/nedbat/coveragepy/issues/1585 revealed that thread tracing gets disabled when passing `concurrency = multiprocessing`. Adding `thread` restores it, and ensures that the `auser()` is reported as covered since the test suite uses `AsyncToSync` to execute this middleware (which spawns threads).
-rw-r--r--.gitignore2
-rw-r--r--docs/internals/contributing/writing-code/unit-tests.txt13
-rw-r--r--tests/.coveragerc2
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 5d408513a4..6b63e32180 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<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..822e6846a9 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