How to properly use coverage.py in Python?

前端 未结 3 1300
暗喜
暗喜 2020-12-23 17:03

I\'ve just started using Coverage.py module and so decided to make a simple test to check how it works.

Sample.py

def sum(num1, num2         


        
3条回答
  •  误落风尘
    2020-12-23 17:49

    It's a little hard to parse through your experiments, and you haven't included the command lines you used with each experiment. But: if you run the tests with:

    python -m py.test test.py
    

    then you can run them under coverage.py with:

    coverage run -m py.test test.py
    

提交回复
热议问题