mirror of
https://github.com/django/django.git
synced 2025-07-11 21:29:12 +00:00
Used coverage module in documentation.
This commit is contained in:
parent
4d11ea1ef0
commit
1e98c107fe
@ -375,19 +375,19 @@ To run coverage on the Django test suite using the standard test settings:
|
|||||||
|
|
||||||
.. console::
|
.. 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:
|
After running coverage, combine all coverage statistics by running:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ coverage combine
|
$ python -m coverage combine
|
||||||
|
|
||||||
After that generate the html report by running:
|
After that generate the html report by running:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ coverage html
|
$ python -m coverage html
|
||||||
|
|
||||||
When running coverage for the Django tests, the included ``.coveragerc``
|
When running coverage for the Django tests, the included ``.coveragerc``
|
||||||
settings file defines ``coverage_html`` as the output directory for the report
|
settings file defines ``coverage_html`` as the output directory for the report
|
||||||
|
@ -867,14 +867,14 @@ following from your project folder containing ``manage.py``:
|
|||||||
|
|
||||||
.. code-block:: shell
|
.. 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
|
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:
|
project. You can see a report of this data by typing following command:
|
||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
coverage report
|
python -m coverage report
|
||||||
|
|
||||||
Note that some Django code was executed while running tests, but it is not
|
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.
|
listed here because of the ``source`` flag passed to the previous command.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user