From the course: Unit Testing in Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Adding test coverage

Challenge: Adding test coverage - Python Tutorial

From the course: Unit Testing in Python

Start my 1-month free trial

Challenge: Adding test coverage

(upbeat music) - [Instructor] Now that we have described the behavior of the fitness tracker as defined in the test suite, do you remember seeing any behavior that was not covered in the test? Using the method we used in a previous video, find the path or function in the source code that is not tested. Write a test of your own at the end of the challenge to expand the source code's coverage. At the bottom of line 53, you'll see an area to write your own test function. Please rename it to reference the source code function you are testing. For example, if you were testing a function called hula hoop you'd change your test function to be called test hula hoop. If you'd like to explore the percentage of test coverage for the fitness log, you can use pytest coverage plug-in to help you. We installed this package into our Docker container at the very start. With this plug-in, you can run pytest--cov scripts to expose test…

Contents