Skip to main content

Generate local badges (shields) reporting your test suite status.

Project description

Pytest local badge

PyPI version CI Tests Coverage

Pytest extension to generate SVG badge files with pytest stats (number of tests passed, pytest-cov coverage statistics.)


Everyone likes pretty code status badges. However, hosting them can get bit troublesome when working on private projects.

This pytest plugin sidesteps the problem by generating local badge files that you can simply add to the project repository and reference in the directly.

Having a bit of extra noise in your change history is worthy cost of having pretty badges, right?


pip install pytest-local-badge


The only thing you have to tell the plugin is where to store badges:

    pytest --local-badge-output-dir badges/

All supported badges will be stored that directory. You can find the complete list of supported options by calling pytest -h and looking for all configuration parameters starting with --local-badge-*.

Here are the options available at the moment:

--no-local-badge      Disable the local badge plugin.
                        The directory to save local badges to.
--local-badge-generate={cov,status} [{cov,status} ...]
                        List of local badges to generate.
                        Desired output file name
                        Desired output file name

Supported badges:

  1. status -- Number of tests (total & passed)
  2. cov -- Coverage report as per pytest-cov plugin (the pytest-cov must be installed separately.)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-local-badge-1.0.3.tar.gz (9.4 kB view hashes)

Uploaded Source

Built Distribution

pytest_local_badge-1.0.3-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page