尽管安装了插件,但我似乎无法使用 Nose 获得代码覆盖率。
关于如何解决这个问题的任何想法?
12:15:25 ~/sandbox/ec$ nosetests --plugins
Plugin xunit
Plugin deprecated
Plugin skip
Plugin multiprocess
Plugin failuredetail
Plugin capture
Plugin logcapture
Plugin coverage
Plugin attributeselector
Plugin doctest
Plugin profile
Plugin id
Plugin allmodules
Plugin collect-only
Plugin isolation
Plugin pdb
12:15:34 ~/sandbox/ec$ nosetests -v --with-coverage
nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module
tests.edgecast_client_tests.test_log ... ok
----------------------------------------------------------------------
Ran 1 test in 0.206s
OK
最佳答案
您是否尝试过 pip 安装覆盖率
?覆盖插件依赖单独的覆盖模块,不是 Nose 的依赖,需要手动安装。
关于python - 如何修复 Python Nose : Coverage not available: unable to import coverage module,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14488601/