Skip to main content

tha.coverage

tha.coverage provides a bin/createcoverage script that servers as a one-line coverage report generator. It is essentially a wrapper around z3c.coverage. It is intended for use inside buildouts, so there are two assumptions:

  • The directory you run this script from is the root of the buildout.

  • There is a bin/test.

Installation and use

To install, add tha.coverage to a zc.recipe.egg section. You often already have one for common scripts. So something like this:

[buildout]
...
parts =
    ...
    console_scripts

[console_scripts]
recipe = zc.recipe.egg
eggs =
    ...
    tha.coverage

This gives you a bin/createcoverage script that does the following:

  • Check whether bin/test exists. Safety feature.

  • Remove old coverage dir if it exists. This way you always have clean results.

  • Run bin/test with the --coverage=... option.

  • Use z3c.coverage to create the actual reports. By default into ./coverage/reports. If you start createcoverage with a command line argument (bin/createcoverage /tmp/output) it will put the reports into that directory.

  • Open the reports in your webbrowser if you did not specify an output directory. The assumption here is that if you run the script as-is, you just want to see the coverage reports. If you do specify an output directory, you’re probably running it from within buildbot or so on the server and you want the output in some webserver-served directory. No use to open a browser on the server.

OSX comment

z3c.coverage uses the “enscript” command for python code highlighting. The version provided by OSX complains about an unkown --footer argument passed by z3c.coverage. There are two possible solutions:

  • Install enscript from macports.

  • Add a script called “enscript” on your path that calls the original enscript minus the offending argument:

    #!/bin/sh
    shift
    /usr/bin/enscript -q --header -h --language=html --color -o - $9

More info

Technical details and a full doctest are in src/tha/coverage/USAGE.txt .

Made by Reinout van Rees at The Health Agency.

TODO

  • Await first bug reports :-)

Changelog of tha.coverage

0.1 (2009-05-13)

  • Implemented first working version. [reinout]

  • Initial library skeleton created by thaskel. [reinout]

Release files for tha.coverage 0.1

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

Source distribution (sdist)

Source distribution for tha.coverage 0.1
File Size Uploaded
tha.coverage-0.1.tar.gz 7.0 kB Details

Release files / tha.coverage-0.1.tar.gz

Download URL tha.coverage-0.1.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f18cfa5d9b1f2780abd56c8527c4690887c63ab16501c889ce4d17f4bf643274
BLAKE2b-256 checksum
How to use checksums
4e811230910170b84b1b2736becc8fe4f341efee9af975697d0af7aaab2e6ec0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.0

1 release file

0.1.1

1 release file

This release

0.1 This release

1 release file

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