The shell commands at the top of the page use test_code.py rather than ch7. They should be:
test_code.py
ch7
$ pytest --cov=cards --cov-report=html ch7
$ pytest --cov=cards ch7 $ coverage html
Agree. That even confused me upon a second read.