Code Monkey home page Code Monkey logo

coveralls-python's Introduction

Coveralls for python

image

image

Coveralls.io is service to publish your coverage stats online with a lot of nice features. This package provides seamless integration with coverage.py in your python projects. For ruby projects, there is an official gem. Only projects hosted on Github are supported.

Works with python 2.6-2.7 and 3.3

Usage (Travis CI)

This library will publish your coverage results on coveralls.io for everyone to see (unless you're using pro account). This package can possibly work with different CI environments, but it's only tested to work with Travis CI atm.

  1. First, log in via Github and add your repo on Coveralls website.
  2. Add pip install coveralls to install section of .travis.yml
  3. Make sure you run your tests with coverage during the build in script part. Example:

    script:
        coverage run --source=coveralls setup.py -q nosetests

    It depends on how you run your tests. Here is another example:

    # --source specifies what packages to cover, you will WANT to use that option
    script:
        coverage run --source=moscowdjango,meetup manage.py test

    Note, that example command will gather coverage for specified package. If you wish to customise what's included in your reports, consult coverage docs.

  4. Execute run coveralls in after_success section:

    after_success:
        coveralls

Full example of .travis.yml:

language: python
python:
  - 2.7
  - 3.3
install:
  - pip install -r requirements.txt --use-mirrors
  - pip install coveralls --use-mirrors
script:
  - coverage run --source=moscowdjango,meetup manage.py test
after_success:
  - coveralls

Usage (another CI)

If you're NOT using Travis, you have to provide at least a repo_token option in .coveralls.yml at the root of your repo. This is your own secret token, which is available at the bottom of your repository's page on Coveralls. Make sure it stays secret, do not put it in your public repo.

Example of .coveralls.yml:

# .coveralls.yml
repo_token: TjkDuVpGjuQcRhNW8dots9c8SSnv7ReM5

How it works

It makes custom report for data generated by coverage.py package and sends it to json API of coveralls.io service. All python files in your coverage analysis are posted to this service along with coverage stats, so please make sure you're not ruining your own security! For private projects there is Coveralls Pro.

Tests

$ python setup.py test

coveralls-python's People

Contributors

asmeurer avatar coagulant avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.