Ticket #4501: 4501_v4.diff

File 4501_v4.diff, 1.5 KB (added by Christopher Medrela, 13 years ago)
  • docs/topics/testing.txt

    diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
    index dc5bf7e..3749300 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.
    554554
     555Integration with coverage.py module
     556-----------------------------------
     557
     558Checking code coverage is important part of testing applications and it's
     559strongly recommended to do it. Django can be integrated with `coverage.py module`_.
     560First, you have to `install coverage.py`_. Now you are ready to use coverage
     561module. Type in your shell:
     562
     563.. _coverage.py module: http://nedbatchelder.com/code/coverage/
     564.. _install coverage.py: http://pypi.python.org/pypi/coverage
     565
     566.. code-block:: bash
     567
     568   coverage -x manage.py test myapp
     569
     570Now tests were launched and coverage data was collected. For each executed file
     571there was created another file with name ending with ``,cover`` containing data
     572about coverage. You can open these files or you can print coverage summary
     573by typing following command.
     574
     575.. code-block:: bash
     576
     577   coverage -r
     578
     579After this all don't forget to delete all collected data by typing:
     580
     581.. code-block:: bash
     582
     583   coverage -e
     584
     585Note that if you don't run last command, coverage data from next launching
     586will be append to existing data.
     587
    555588Testing tools
    556589=============
    557590
Back to Top