'How do I integrate travis ci with codeclimate test coverage in Python?

I'm trying to make my Travis CI send test coverage data to Code Climate service, but documentation on Code Climate and Travis CI do not describe in detail how to do this using Python. Still its supported feature according Code Climate and Travis documentations. I've tried to find any working examples on this without luck and can't make it work on my own.

Code Climate documentation: Setting Up Test Coverage, Readme: codeclimate-test-reporter

Travis CI documentation: Using Code Climate with Travis CI

I've set the CODECLIMATE_REPO_TOKEN in Travis CI as described in this answer: https://stackoverflow.com/a/31281481/1754089

My .travis.yml file:

language: python
python:
  - 2.7
install:
  - pip install -r requirements.txt
  - pip install coverage
  - pip install codeclimate-test-reporter
#commands to run tests:
script:
  - python mytests.py
  - coverage run mytests.py
after_success:
  - codeclimate-test-reporter

as the after_success line is excecuted in Travis it gives me this in log-view:

/home/travis/build.sh: line 45: codeclimate-test_reporter: command not found


Solution 1:[1]

The codeclimate python-test-reporter has since been deprecated. Updated way to handle test-report for python using travis-ci can be found at https://github.com/codeclimate/test-reporter/blob/master/examples/python_examples.md

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arthur Nangai