python - 如何修复 Python Nose : Coverage not available: unable to import coverage module

标签 python nose coverage.py python-coverage

尽管安装了插件,但我似乎无法使用 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/

相关文章:

python - 如何在Python多模块的覆盖范围中排除目录

python - 使用单个服务器端变量处理多个复选框

python - matplotlib 对 x Axis 的值进行分组

python - 禁用 Nose 的一个示例测试

python - 警告 : Failed to generate report: No data to report error in python using pytest module

python - Coverage.py/Cython - 无法使用单元测试追踪复杂项目中的 Cython 库

python - 正则表达式最佳实践 : is it ok to use regex to match multiple phrases?

python pandas 抛出解析错误

python - 如何在( Nose )测试执行期间显示 Python 警告?

python - Nosetests assert_equal 显然不等于 python ==