Test Coverage
For the next exercises, you need to install a small plugin:
pip install pytest-cov
Exercise 1: Calculate Test Coverage
Calculate the percentage of code covered by automatic tests:
pytest --cov
Exercise 2: Identify uncovered lines
Find out which lines are not covered by tests. Execute
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%.