Test Coverage

For the next exercises, you need to install a small plugin:

  1. pip install pytest-cov

Exercise 1: Calculate Test Coverage

Calculate the percentage of code covered by automatic tests:

  1. pytest --cov

Exercise 2: Identify uncovered lines

Find out which lines are not covered by tests. Execute

  1. coverage html

And open the resulting htmlcov/index.html in a web browser.

Exercise 3: Increase test coverage

Bring test coverage of word_counter.py to 100%.