Skip to main content

sources pypi build documentation license

Nowadays, every trendy project has a collection of shiny littel badges. They look great, but they can be hard to get. This modules is here to help you to get the 100 % test coverage badge, without any effort.

What’s new?

See changelog.

Download and install

  • From sources:

  • From pip:

    pip install fullcoverage
  • Quick and dirty Debian (and Ubuntu?) package

    This requires stdeb to be installed:

    python3 setup.py --command-packages=stdeb.command bdist_deb
    sudo dpkg -i deb_dist/fullcoverage-<VERSION>_all.deb

How-to

Let’s say you want to get you module foobar thoroughly covered.

  1. Install fullcoverage:

    pip install fullcoverage
  2. Enable this plugin. That is, in the .coveragerc file of foobar, have the lines:

    [run]
    plugins = fullcoverage.plugin
  3. Optionnaly, if you want to restrict the test report to your module, you can add, in the same .coveragerc file:

    [fullcoverage.plugin]
    source = foobar
  4. If you already have tests that import all of foobar submodules, that’s it. Otherwise, somewhere in your tests, have the following lines import everything in your module:

    import foobar
    import fullcoverage
    
    fullcoverage.import_all(foobar)
  5. That’s it! You can now run your tests:

    coverage run --source foobar -m unittest
    coverage report --fail-under=100

Bugs and Limitations

  • This does not work with doctest. Please feel free to send a patch.

  • This only works with python 3.5. Please feel free to send a patch.

  • Even though tests cover 100 % of your module, it may still contain bugs.

FAQ

  • Isn’t it dangerous? Are you running every line of a module to get 100 % test coverage? What if you run a line shutil.rmtree('/') ?

This plugins does not run random line of codes. It imports every plugin that is to be covered, but it cheats coverage into thinking they were thoroughly tested, without testing anything. If your module is safe to import, it is safe to use fullcoverage. If your module is not safe to import, fix your module.

  • If your plugin is so great, why aren’t you showing off with one of those 100 % coverage badges?

Well, fullcoverage is hosted on a Gitlab instance, which does not provide those badges yet. But this plugin is implemented to test itself, and it is thoroughly covered by tests.

Release files for fullcoverage 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fullcoverage 0.1.0
File Size Uploaded
fullcoverage-0.1.0.tar.gz 24.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fullcoverage 0.1.0
File Interpreter ABI Platform
fullcoverage-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.4 kB

Release files / fullcoverage-0.1.0.tar.gz

Download URL fullcoverage-0.1.0.tar.gz
Size 24.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f7ba17150efafd8336cd7266cfd93cf01a13401fd305c1f9fbc37f9d97ea2395
BLAKE2b-256 checksum
How to use checksums
ae0493acd2ad4f51c90ee63386094b998c6b2256d7b66deba9370a6ffa6565dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / fullcoverage-0.1.0-py3-none-any.whl

Download URL fullcoverage-0.1.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ae2005f36a6167c8de81c8a7c6f31fd42e1b4ede92842fc33a7ab04dd7c9233
BLAKE2b-256 checksum
How to use checksums
4e714ad2e521b4b41b8cf5ae55520f69772e2ef0365b45962adbc06affd14e5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page