Enhance your python unit testing using Coverage

Offered By
Coursera Project Network
In this Guided Project, you will:

Use coverage.py to ensure that every bit of your python code is covered by a test

Create test functions for a python class, one method and a time

Cover different aspects of your code and use the cool web interface of coverage.py to monitor your progress

Clock2 hours
IntermediateIntermediate
CloudNo download needed
VideoSplit-screen video
Comment DotsEnglish
LaptopDesktop only

In this 1-hour long project-based course, you will learn how to you can use coverage.py to ensure that every bit of your python code is covered by a test - hence the name coverage.py. You will create test functions for a python class, one method and a time. At each step, you will learn how to cover different aspects of your code and use the cool web interface of coverage.py to monitor your progress. Note: This course works best for learners who are based in the North America region. We’re currently working on providing the same experience in other regions.

Skills you will develop

Python ProgrammingObject-Oriented Programming (OOP)Python TestingCoverage measurement

Learn step-by-step

In a video that plays in a split-screen with your work area, your instructor will walk you through these steps:

  1. Understand the Theatre booking code

  2. Measure coverage for testing class methods

  3. Measure coverage of branching code

  4. Exclude code from coverage

  5. Create static and dynamic measurement contexts

How Guided Projects work

Your workspace is a cloud desktop right in your browser, no download required

In a split-screen video, your instructor guides you step-by-step

Frequently asked questions

Frequently Asked Questions

More questions? Visit the Learner Help Center.