Does coverage.py measure the function and class definitions?

前端 未结 2 1526
终归单人心
终归单人心 2020-12-16 13:24

I am trying to achieve a 100% coverage for a basic python module. I use Ned Batchelder\'s coverage.py module to test it.

1 class account(object):
2   def __i         


        
2条回答
  •  不思量自难忘°
    2020-12-16 14:05

    Following jcollado's answer:

    I have this problem with Django nose which only covers lines used by tests.

    For fix it I launch firstly manage.py with coverage and after I launch tests. .coverage file will contain both's reports.

    My first command is a custom which prints my project settings. Example:

    coverage run ./manage.py settings && ./manage.py test myapp
    

提交回复
热议问题