GithubHelp home page GithubHelp logo

example-python's Introduction

website: Codecov.

# 1) install codecov
pip install codecov

# 2) next call "codecov" at end of CI build
# public repo using Travis, CircleCI or AppVeyor
codecov

# all other CI and private repositories
codecov --token=<repo token>

You can alternatively use the environment variables:

Argument Environment Description
-t CODECOV_TOKEN Private repo token for uploading
-e CODECOV_ENV List of config vars to store for the build
-F ย  Flag this upload to group coverage reports. Ex. unittests or integration. Read the docs.

coverage.py is required to collect coverage metrics.

Below are some examples on how to include coverage tracking during your tests. Codecov will call coverage xml -i automatically to generate the coverage xml output, which will be archived and processed server side.

You may need to configure a .coveragerc file. Learn more here. Start with this generic .coveragerc for example.

We highly suggest adding source to your .coveragerc, which solves a number of issues collecting coverage.

[run]
source=your_package_name

If there are multiple sources, you instead should add include to your .coveragerc

[run]
include=your_package_name/*
pip install coverage
coverage run tests.py
pip install pytest pytest-cov
pytest --cov=./
nosetests --with-coverage

See the Offical Nose coverage docs for more information.

Codecov can be run from inside your tox.ini please make sure you pass all the necessary environment variables through:

[testenv]
passenv = CI TRAVIS TRAVIS_*
deps = codecov
commands = codecov

See all the environment variables for other CI providers.


As far as python is concerned, nothing. You may choose to use either uploader. Codecov recommends using the bash uploader when possible as it supports more unique repository setups.

Learn more at codecov/codecov-bash and codecov/codecov-python.

This output is written by running the command coverage xml and states that there were no .coverage files found.

  1. Make sure coverage is enabled. See Enabling Coverage
  2. You may need to run coverage combine before running Codecov.
  3. Using Docker? Please follow this step: Testing with Docker.

No, these files contain coverage data but are not properly mapped back to the source code. We rely on coveragepy to handle this by calling coverage xml in the uploader.

Please see the documentation at our Python repository

Details on the badges and graphs can be found under settings/Badge, for example the following RST can be used:

.. image:: https://codecov.io/gh/codecov/example-python/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/codecov/example-python

Which will generate:

We are happy to help if you have any questions. Please contact email our Support at [email protected].

example-python's People

Contributors

thomasrockhu avatar gundalow avatar sbeidas-test avatar tomped avatar yurovant avatar briandant avatar willingc avatar codecov-test avatar blueyed avatar gabswim avatar ianlee1521 avatar nneast avatar ticosax avatar pquentin avatar richienb avatar stevepeak avatar bromne avatar

Watchers

James Cloos 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.