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.
http://www.voidspace.org.uk/python/articles/unittest2.shtml#unicode-string-comparison
精彩评论