How do I make coverage include not tested files?

后端 未结 2 519
温柔的废话
温柔的废话 2021-01-30 13:11

I have just started writing some unit tests for a python project I have using unittest and coverage. I\'m only currently testing a small proportion, bu

2条回答
  •  不思量自难忘°
    2021-01-30 13:36

    If you use nose as a testrunner instead, the coverage plugin for it provides

      --cover-inclusive     Include all python files under working directory in
                            coverage report.  Useful for discovering holes in test
                            coverage if not all files are imported by the test
                            suite. [NOSE_COVER_INCLUSIVE]
    
      --cover-tests         Include test modules in coverage report
                            [NOSE_COVER_TESTS]
    

提交回复
热议问题