How do I make coverage include not tested files?

冷暖自知 提交于 2019-12-02 15:32:05
Ned Batchelder

Add --source=. to the coverage run line. It will both limit the focus to the current directory, and will search for .py files that weren't run at all.

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]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!