문제

Is there a library which of nose-friendly assertions things like membership and identity (eg, assert_contains(x, y), assert_is(a, b))?

도움이 되었습니까?

해결책

Nose provides stand-alone versions of the stdlib assertions:

from nose.tools import assert_in, assert_is

For older Pythons, the unittest2 versions can likely be wrapped using a technique similar to what's in tools.py.

다른 팁

Stdlib unittest provide both assertIn and assertIs and can be run via nose. Are you looking for something other than that? BTW, these methods are available since python 2.7 only and if you want them for older version of python, it is available from unittest2 package

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top