如何修复Python的鼻子:覆盖率不可用:无法导入覆盖率模块

尽pipe安装了插件,但我似乎无法使用鼻子获得代码覆盖范围。

有想法该怎么解决这个吗?

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 install coverage ? 覆盖插件依赖于单独的覆盖模块,这不是鼻子的依赖,所以需要手动安装。