Ticket #4501: 4501_v5.diff

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

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