Skip to main content

UNKNOWN

Project description

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 before 10.5.7 complains about an unkown --footer argument passed by z3c.coverage. There are two possible solutions:

  • Update to 10.5.7. That update came out a few minutes after I wrote this original comment :-)

  • 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.1 (2009-05-13)

  • Doc update: osx 10.5.7 fixes the enscript problem. [reinout]

  • Cleaned up some thaskel-added stuff that’s not needed for a generic library. [reinout]

0.1 (2009-05-13)

  • Implemented first working version. [reinout]

  • Initial library skeleton created by thaskel. [reinout]

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

tha.coverage-0.1.1.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file tha.coverage-0.1.1.tar.gz.

File metadata

File hashes

Hashes for tha.coverage-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5d9bc5c2cef31695a03186b2b2a592395db396c220e3304ead765fbb39eff873
MD5 4e5596eaefc57bfd61e0d026bf56cd7c
BLAKE2b-256 ae28e0fdf8ff706885dedb8a5edd718575bbe2cc593deaeadb7d5773279cc909

See more details on using hashes here.

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