Ticket #4501: 4501_v6.diff

File 4501_v6.diff, 1.7 KB (added by Christopher Medrela, 5 years ago)
  • docs/topics/testing.txt

    diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
    index 829e059..d30c236 100644
    a b failed and erroneous tests. If all the tests pass, the return code is 0. This 
    553553feature is useful if you're using the test-runner script in a shell script and
    554554need to test for success or failure at that level.
     556Integration with coverage.py module
     559Code coverage describes how much source code have been tested. It indicates
     560quality of your tests - the better code coverage is, the more lines are covered
     561by tests and the better tests are. It's important part of testing applications,
     562so it's strongly recommended to check coverage.
     564Django can be easily integrated with `coverage.py module`_. First, you have to
     565`install coverage.py`_. Now you are ready to use coverage module.
     566When you are in your project folder, type in your shell:
     568.. _coverage.py module: http://nedbatchelder.com/code/coverage/
     569.. _install coverage.py: http://pypi.python.org/pypi/coverage
     571.. code-block:: bash
     573   coverage run --source='.' manage.py test myapp
     575Now tests were launched and coverage data of all executed files in your project
     576folder was collected. You can see a report by typing following command:
     578.. code-block:: bash
     580   coverage report
     582Note that some of django code was executed during running tests, but
     583it was not listed here because of flag ``source`` given to previous command.
     585After this all don't forget to delete all collected data by typing:
     587.. code-block:: bash
     589   coverage erase
     591Note that if you don't run last command, coverage data from next launching
     592will be appended to existing data.
    556594Testing tools
Back to Top