0

I'm trying to implement a test code coverage and I'm having problems with coveralls. For doing this i'm following this guide:

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

My problem is that when you I run coveralls the system warns me that coverage module is not available.

Since the module was not available, I tried to install using pip, I read that apt is wrong with travis-ci, and it told me that was already.

I don't have any problem with the travis-ci tests itself. They run ok. I execute all the coveralls code in after_success section.

$ 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

Is there a special way to install the coverage module?

Remi Guan
  • 21,506
  • 17
  • 64
  • 87
Samuel Góngora
  • 141
  • 1
  • 11

1 Answers1

0

After doing more research I found a solution for this answer.

I forgot to install the module coveralls in the install section.

install:
- pip install coveralls

The system reports me:

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

I hope that this answer could help somebody in the future.

Samuel Góngora
  • 141
  • 1
  • 11