2015-10-22 61 views
0

我試圖實現測試代碼覆蓋率,並且遇到工作服的問題。這樣做的我已經遵守本指南:模塊覆蓋率不可用於工作服測試

https://github.com/coagulant/coveralls-python

我的問題是,當你我運行連身系統警告我說,覆蓋模塊不可用。

由於該模塊不可用,我嘗試使用pip進行安裝,我讀到了travis-ci的apt錯誤,它告訴我已經是這樣了。

我對travis-ci測試本身沒有任何問題。他們運行正常。我在after_success部分執行所有工作服代碼。

$ pip install coverage 
You are using pip version 6.0.7, however version 7.1.2 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 
Requirement already satisfied (use --upgrade to upgrade): coverage in /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages 

after_success.3 0.11s$ coveralls 

Traceback (most recent call last): 
    File "/home/travis/virtualenv/python2.7.9/bin/coveralls", line 11, in <module> 
    sys.exit(wear()) 
    File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/coveralls/__init__.py", line 76, in wear 
    from coveralls.control import coveralls 
    File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/coveralls/control.py", line 1, in <module> 
    from coverage.control import coverage 
ImportError: cannot import name coverage$ pip install coverage 
You are using pip version 6.0.7, however version 7.1.2 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 
Requirement already satisfied (use --upgrade to upgrade): coverage in /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages 

after_success.3 0.11s$ coveralls 

Traceback (most recent call last): 
    File "/home/travis/virtualenv/python2.7.9/bin/coveralls", line 11, in <module> 
    sys.exit(wear()) 
    File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/coveralls/__init__.py", line 76, in wear 
    from coveralls.control import coveralls 
    File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/coveralls/control.py", line 1, in <module> 
    from coverage.control import coverage 
ImportError: cannot import name coverage 

是否有特殊的方法來安裝覆蓋模塊?

回答

0

在做了更多的研究後,我找到了這個答案的解決方案。

我忘了在安裝部分安裝模塊工作服。

install: 
- pip install coveralls 

系統報告我:

$ coveralls 
Submitting coverage to coveralls.io... 
Coverage submitted! 

我希望這個答案可以幫助別人的未來。