but was: <...b[]d...>开发者_Go百科\'" />
开发者

Is there a python unit test framework that gives compact error output when comparing strings

开发者 https://www.devze.com 2023-01-24 01:53 出处:网络
Using the Java JUnit framework and comparing the strings \"abcde\" and \"abde\" you would get the error output \'expected:<...b[c]d...> but was: <...b[]d...>开发者_Go百科\'

Using the Java JUnit framework and comparing the strings "abcde" and "abde" you would get the error output 'expected:<...b[c]d...> but was: <...b[]d...>开发者_Go百科'

Using python unittest I get "abcde" != "abde" which is not all as useful if you are dealing with long strings.

So my question is: Is there a python unit test framework that gives the same compact output as JUnit for Java?


The unittest2 package is a backport (to Python >= 2.4) of features that are native to the PyUnit (unittest) framework in Python 2.7.

It includes enhanced string comparison features.

Is there a python unit test framework that gives compact error output when comparing strings

http://www.voidspace.org.uk/python/articles/unittest2.shtml#unicode-string-comparison

0

精彩评论

暂无评论...
验证码 换一张
取 消