最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【未解决】尝试用Python的Coverage测试代码覆盖率

Python crifan 1236浏览 0评论
通过:
Porting Python 2 Code to Python 3 — Python 3.7.1 documentation
-》
coverage · PyPI
Coverage.py — Coverage.py 4.5.2 documentation
去安装试试:
➜  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测试代码覆盖率

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.194 seconds, using 22.08MB memory