Python nose2

From wikinotes

nose2 is the followup library to nose. It is built on top of unittest2 (but so far seems to remain compatible with unittest). The primary reason for migrating from nose to nose2 was the ability to support python2/3 code at the same time.

nose2 adds discovery features that allow you to call very fine-grained portions of your unittests. Packages, files, classes, individual tests. nose is also customizable, and has some very impressive plugins.


Usage

nose2       ## discover all tests under the current directory
green -vvv  ## use nose2 (through the ''colourized'' green module)

Plugins

green (colour)

Green is a plugin for nose2 that performs 2x very useful things

  • colourized output
  • simple flags to adjust amount of printed information
  • tab completion of files, classes, and methods!!!


Install

sudo pip install green

#### ~/.bashrc
which green >& /dev/null && source "$( green --completion-file )"
####

Usage

green -vvv  ## use nose2 (through the ''colourized'' green module)

green2      ## green also differetiates between python versions.
green3      #  (thank you!)