How to specify what code is covered by a unit-test?

Viewed 66

In PHPunit there is @covers annotation to specify which classes/methods/functions are covered by a specific unit test. This helps avoiding false-coverage.

Is there a way to do something similar in the Python unit-test world?

I am using Python 3.6 with pytest for unit-testing and am free to choose any coverage tool that will allow me to annotate or mark my tests with what code (unit) they do cover and do not cover.

I am hoping for something like annotations or pragma comments to be used in the unit-tests. Preferably supported by the PyCharm if possible.

0 Answers
Related