通过:
-》
去安装试试:
➜ xxx git:(master) ✗ pip install coverage --user Collecting coverage Using cached https://files.pythonhosted.org/packages/6b/ef/ac074c224f3bf6ce4079dc84f5a0ffa793c6928c29f902260b8d6e2b1d94/coverage-4.5.2-cp27-cp27m-macosx_10_13_intel.whl matplotlib 1.3.1 requires nose, which is not installed. matplotlib 1.3.1 requires tornado, which is not installed. pyopenssl 18.0.0 has requirement six>=1.5.2, but you'll have six 1.4.1 which is incompatible. Installing collected packages: coverage Successfully installed coverage-4.5.2 You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
再找个Python文件试试
➜ resources git:(master) ✗ coverage run bookSearch.py Traceback (most recent call last): File "bookSearch.py", line 5, in <module> from SolrClient import SolrClient ImportError: No module named SolrClient
结果不对,需要找到可以运行的项目文件才可以。
官网例子结果是:
转载请注明:在路上 » 【未解决】尝试用Python的Coverage测试代码覆盖率