Python nose: assertion library?

Is there a library in which nose-friendly statements include things like membership and identity (e.g. assert_contains(x, y) , assert_is(a, b) )?

+7
source share
2 answers

Nose provides standalone versions of stdlib statements:

 from nose.tools import assert_in, assert_is 

For older Python versions of unittest2 can be wrapped using techniques similar to those in tools.py.

+10
source

Stdlib unittest provides both assertIn and assertIs and can be run through the nose. Are you looking for something else? BTW, these methods are only available since python 2.7, and if you want them for an older version of python, it is available from unittest2 package

+3
source

All Articles