All Projects → codecov → Example Python

codecov / Example Python

Python coverage example

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Example Python

D.s.a Leet
References and summary for leetcode high-frequency algorithm problems
Stars: ✭ 155 (-34.87%)
Mutual labels:  coverage
Minicover
Cross platform code coverage tool for .NET Core
Stars: ✭ 193 (-18.91%)
Mutual labels:  coverage
Browser Extension
Codecov Browser Extension
Stars: ✭ 212 (-10.92%)
Mutual labels:  coverage
Coveragechecker
Allows old code to use new standards
Stars: ✭ 159 (-33.19%)
Mutual labels:  coverage
Sonar Stash
Stash (BitBucket) plugin, a pull-request decorator which allows to integrate SonarQube violations directly into your pull-request
Stars: ✭ 174 (-26.89%)
Mutual labels:  coverage
Deep Cover
The best coverage tool for Ruby code
Stars: ✭ 196 (-17.65%)
Mutual labels:  coverage
Moderncppstarter
🚀 Kick-start your C++! A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and much more.
Stars: ✭ 2,381 (+900.42%)
Mutual labels:  coverage
Sonar Golang
Sonarqube plugin for the golang language.
Stars: ✭ 229 (-3.78%)
Mutual labels:  coverage
Goleft
goleft is a collection of bioinformatics tools distributed under MIT license in a single static binary
Stars: ✭ 175 (-26.47%)
Mutual labels:  coverage
Python Mocket
a socket mock framework - for all kinds of socket animals, web-clients included
Stars: ✭ 209 (-12.18%)
Mutual labels:  coverage
Codecov Python
Python report uploader for Codecov
Stars: ✭ 162 (-31.93%)
Mutual labels:  coverage
Coverlet
Cross platform code coverage for .NET
Stars: ✭ 2,303 (+867.65%)
Mutual labels:  coverage
Bisect ppx
Code coverage for OCaml and ReScript
Stars: ✭ 204 (-14.29%)
Mutual labels:  coverage
Covered
Stars: ✭ 158 (-33.61%)
Mutual labels:  coverage
Ehtrace
ATrace is a tool for tracing execution of binaries on Windows.
Stars: ✭ 218 (-8.4%)
Mutual labels:  coverage
Single cov
Actionable code coverage.
Stars: ✭ 154 (-35.29%)
Mutual labels:  coverage
Nxplorerjs Microservice Starter
Node JS , Typescript , Express based reactive microservice starter project for REST and GraphQL APIs
Stars: ✭ 193 (-18.91%)
Mutual labels:  coverage
Axocover
Nice and free .Net code coverage support for Visual Studio with OpenCover.
Stars: ✭ 237 (-0.42%)
Mutual labels:  coverage
Codecov Bash
Global coverage report uploader for Codecov
Stars: ✭ 220 (-7.56%)
Mutual labels:  coverage
Cmake Scripts
A selection of useful scripts for use in CMake projects, include code coverage, sanitizers, and dependency graph generation.
Stars: ✭ 202 (-15.13%)
Mutual labels:  coverage

Codecov Python Example

FOSSA Status

Guide

GitHub Actions

A minimal configuration for public repos:

steps:
  # (Other steps go here)
  - name: "Upload coverage to Codecov"
    uses: codecov/[email protected]
    with:
      fail_ci_if_error: true

See codecov/codecov-action for more information, a detailed example, and other options.

Travis Setup

Add the following to your .travis.yml:

language:
  python
after_success:
  - bash <(curl -s https://codecov.io/bash)

Produce Coverage Reports

coverage.py is required to collect coverage metrics.

Below are some examples on how to include coverage tracking during your tests. Codecov will call coveragexml -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

unittests

pip install coverage
coverage run tests.py

pytest

pip install pytest-cov
pytest --cov=./

nosetests

nosetest --with-coverage

See the Offical Nose coverage docs for more information.

Testing with tox

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

FAQ

  • Q: What's the difference between the codecov-bash and codecov-python uploader?
    A: 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.
  • Q: Why am I seeing No data to report?
    A: 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: Codecov Inside Docker.
  • Q: Can I upload my .coverage files?
    A: 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.

Caveats

Private Repo

Repository tokens are required for (a) all private repos, (b) public repos not using the GitHub Actions, Travis CI, CircleCI or AppVeyor.

Find your repository token at Codecov and provide via appending -t <your upload token> to you where you upload reports.

Cobertura Reports

Cobertura reports can expire - Codecov will reject reports that are older than 12 hours. The logs contain details if a report expired.

Links

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].