diff --git a/docs/internals/contributing/writing-code/unit-tests.txt b/docs/internals/contributing/writing-code/unit-tests.txt index 3641bfb8cc..4f883b097d 100644 --- a/docs/internals/contributing/writing-code/unit-tests.txt +++ b/docs/internals/contributing/writing-code/unit-tests.txt @@ -375,19 +375,19 @@ To run coverage on the Django test suite using the standard test settings: .. console:: - $ coverage run ./runtests.py --settings=test_sqlite + $ python -m coverage run ./runtests.py --settings=test_sqlite After running coverage, combine all coverage statistics by running: .. console:: - $ coverage combine + $ python -m coverage combine After that generate the html report by running: .. console:: - $ coverage html + $ python -m coverage html When running coverage for the Django tests, the included ``.coveragerc`` settings file defines ``coverage_html`` as the output directory for the report diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt index 6b03f0f82b..b684459c5b 100644 --- a/docs/topics/testing/advanced.txt +++ b/docs/topics/testing/advanced.txt @@ -867,14 +867,14 @@ following from your project folder containing ``manage.py``: .. code-block:: shell - coverage run --source='.' manage.py test myapp + python -m coverage run --source='.' -m manage test myapp This runs your tests and collects coverage data of the executed files in your project. You can see a report of this data by typing following command: .. code-block:: shell - coverage report + python -m coverage report Note that some Django code was executed while running tests, but it is not listed here because of the ``source`` flag passed to the previous command.