Skip to main content

Green is a clean, colorful test runner for Python unit tests. Compare it to nose or trial.

Project description

Green
=====

Clean, colorful test runner for Python
--------------------------------------

Green is a clean, colorful test runner for Python unit tests. Compare it to
nose or trial.

Green grew out of a desire to see pretty colors. Really! A big part of the
whole the **Red/Green/Refactor** process in test-driven-development is
_actually getting to see red and green output_. Most python unit testing
actually goes **Gray/Gray/Refactor** (at least on my terminal, which is gray
text on black background). That's a shame. Even TV is in color these days.
Why not terminal output? Even worse, the default output for most test runners
is cluttered, hard-to-read, redundant, and the dang statuses are not aligned
vertically! Green fixes all that.

### Features ###

- Colored terminal output
- Aligned status indicators
- Test discovery
- Flexible test target specification
- No new objects to learn -- just use normal `unittest` classes.
- HTML output
- Four verbosity levels
- Built-in, optional, integration with
[coverage](http://nedbatchelder.com/code/coverage/)
- Supports Python 2.7, 3.4+
- Supports OS X, Linux, BSDs (and maybe Windows)

### Wish List ###

- Supports Python 3.3, 3.2 (which may already work -- need to verify...)
- Parallel test-running (multiprocessing)

Basic Usage
-----------

To use Green to run existing Python unit tests, just run `greenX.Y` in the home
directory of your project (Substitute your version of Python in for `X.Y`. For
example: `green2.7` for Python 2.7, `green3.4` for Python 3.4, etc.).

By default, Green mimics the verbosity levels of vanilla unittest or nose,
meaning that output is mostly just dots. For Green we recommend adding more
verbosity by using the `-v` or `-vv` options.

To run Green's own internal unit tests (which are hopefully all passing):

green3.4 -v green

To see all examples of all the failures, errors, etc. that could occur:

green3.4 -v green.examples


Advanced Usage
--------------

Please see `green3.4 --help`


Install
-------

Replace `pip3` with your version of pip if necessary. You may need to prepend
this command with `sudo` or run it as root if your normal user cannot write to
the local Python package directory.

pip3 install green


Upgrade
-------

pip3 install --upgrade green

Wait...what do I have installed?

green3.4 --version


Uninstall
---------

pip3 uninstall green

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

green-0.9.9.3.tar.gz (14.0 kB view details)

Uploaded Source

File details

Details for the file green-0.9.9.3.tar.gz.

File metadata

  • Download URL: green-0.9.9.3.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for green-0.9.9.3.tar.gz
Algorithm Hash digest
SHA256 9b11975274b2207300226a9e6cce9c08872d367daa0edddad02eb9003282fcf9
MD5 59dd24c6cf18ac31fe53f67e036f8c1a
BLAKE2b-256 11be28d47dd1f06f225044784b4d03ca09e227ee631076839c5a5e53af86b7ed

See more details on using hashes here.

Supported by

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