Yaroslav Nikitenko
Yaroslav Nikitenko

Reputation: 1853

pytest coverage for class methods

I have a class with many methods that I regularly test with a command

python3 -m pytest --doctest-modules --cov=yarsync --cov-report term-missing yarsync tests

Unfortunately, it outputs missing lines for the whole class (module), like

yarsync/yarsync.py     1031    259    75%   60, 69-70, 77, 160-167, ...

Is it possible to split output based on class methods? I tried annotate, but that seems redundant (and already discouraged by developers).

Upvotes: 0

Views: 368

Answers (1)

Ned Batchelder
Ned Batchelder

Reputation: 375744

Coverage.py doesn't divide its reports into methods. You can use the line numbers to find the problem areas in your code. coverage html provides a highlighted HTML report.

Upvotes: 1

Related Questions