Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #4501 - Documented how to use with Django tests.

Thanks krzysiumed for the draft patch.
  • Loading branch information...
commit 7ef2781ca0ce48872e21dce2f322c9e4106d1cfd 1 parent f7b6966
@timgraham timgraham authored
Showing with 28 additions and 0 deletions.
  1. +28 −0 docs/topics/testing.txt
28 docs/topics/testing.txt
@@ -589,6 +589,34 @@ to a faster hashing algorithm::
Don't forget to also include in :setting:`PASSWORD_HASHERS` any hashing
algorithm used in fixtures, if any.
+Integration with
+Code coverage describes how much source code has been tested. It shows which
+parts of your code are being exercised by tests and which are not. It's an
+important part of testing applications, so it's strongly recommended to check
+the coverage of your tests.
+Django can be easily integrated with ``_, a tool for measuring code
+coverage of Python programs. First, `install`_. Next, run the
+following from your project folder containing ````::
+ coverage run --source='.' 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::
+ 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.
+For more options like annotated HTML listings detailing missed lines, see the
+``_ docs.
+.. _install
Testing tools

1 comment on commit 7ef2781


Hooray for getting coverage in!

I was thinking that this should be extended with the better parts of - which had in some ways is a more complete approach to coverage in Django ( - which probably should have been marked as a dupe)

Please sign in to comment.
Something went wrong with that request. Please try again.