Python 鼻测试-从覆盖率报告中排除dir
我的python应用程序结构如下:Python 鼻测试-从覆盖率报告中排除dir,python,nose,coverage.py,python-coverage,Python,Nose,Coverage.py,Python Coverage,我的python应用程序结构如下: proj - comp1 - comp2 tests - comp1 - comp2 other - contains some python code 我正在进行如下鼻测试: nosetests --with-coverage --cover-package=proj --exclude-dir=other -v tests 然而,在nosetests最后打印的覆盖率报告中,我仍然有来自“其他”的条目。如何从覆盖率报告中排
proj
- comp1
- comp2
tests
- comp1
- comp2
other
- contains some python code
我正在进行如下鼻测试:
nosetests --with-coverage --cover-package=proj --exclude-dir=other -v tests
然而,在nosetests最后打印的覆盖率报告中,我仍然有来自“其他”的条目。如何从覆盖率报告中排除“其他”?很可能您的
测试或proj
引用了other
python代码,因此,它将其纳入报告中。您可以看到调试覆盖率插件打印输出:
nosetests --with-coverage --cover-package=proj -vv tests -l nose.plugins.cover
是的,proj引用了“其他”python代码。“other”实际上是一组第三方python库。这就是为什么我想把它从报道中排除。