By continuing to navigate on this website, you accept the use of cookies to serve you more relevant services & content.
For more information and to change the setting of cookies on your computer, please read our Cookie Policy.

Check test coverage in Django code with Coveralls

Coverage: It is a tool used for showing the percentage of your codebase covered by tests.

Test Coverage is an important indicator of software quality and an essential part of software maintenance. It helps in evaluating the test cases by providing the data on different coverage items. It is a useful tool for finding untested part of a code.

Test coverage can help in monitoring the quality of testing and assist in directing the test generators to create test cases that cover areas that have not been tested. It helps to measure the quality and identifies unnecessary test cases which will not increase coverage.

Benefits of Test Coverage:

Defect prevention in the project.
It creates additional test cases to increase coverage.
It helps in determining a quantitative measure of code coverage, which indirectly measures the quality of the application or product.

Installation: Pip install coverage

Use "coverage run" to run your program and gather data:

coverage run manage.py test

coverage report -m  # provides the report for the tests

Individual app test can be run using the command

coverage run --source=app1,app2 manage.py test

    Posted On
  • 13 February 2016
  • By
  • Micropyramid

Need any Help in your Project?Let's Talk

Latest Comments
Related Articles
Google plus API integration with django

Using GPlus integration, we can get the user verified email id, general information, friends in a less span of time, and user can also share ...

Continue Reading...
Setting Up Coveralls for Django Project

Coveraslls will check the code coverage for your test cases. To use coveralls.io your code must be hosted on GitHub or BitBucket.

install coveralls
...

Continue Reading...
Improving page speed score in Google Page Score test- PART2

In our previous blog post we got an idea of what are the things that Google's Page Speed Insights will take into count to give ...

Continue Reading...
open source packages

Subscribe To our news letter

Subscribe and Stay Updated about our Webinars, news and articles on Django, Python, Machine Learning, Amazon Web Services, DevOps, Salesforce, ReactJS, AngularJS, React Native.
* We don't provide your email contact details to any third parties