On Mon, 2010-08-16 at 01:25 +0100, Floris Bruynooghe wrote: > Hi > > Ever since unittest grew it's .assertSequenceEqual() and > .assertMultilineEqual() I've been jealous of it. So this weekend I've > looked into the py.test code and made an attempt at getting this into > my favourite testing tool. > > The attached patch makes compare equal a special case and checks if > the two arguments to it are both a list, text or dict and tries to > generate a nicer explanation text for them. The patch is more like a > proof of concept then a final implementation, I may have done some > very strange or silly things as I'm not familiar with the code. It > would be great to get feedback, both on the general concept and the > actual implementation (particularly note the way I had to hack > _format_explanation() in assertion.py). >
I think it will be helpful to have some kind of hook to add more explain-functions In particular, cause there are many more build-in types to manage, and i have at least 2 projects where custom compare-explain is helpfull another wishlist item i see is the rest of rich compare i.e. <, >, <=, >=, != > Some of the rough edges I can think off right now: (i) no idea how > comparisons and nested calls work together, (ii) no attempt is made to > limit the output from difflib so the screen doesn't get flooded. > There's probably many more. > > I hope this can be useful > Floris > > _______________________________________________ > py-dev mailing list > py-dev@codespeak.net > http://codespeak.net/mailman/listinfo/py-dev _______________________________________________ py-dev mailing list py-dev@codespeak.net http://codespeak.net/mailman/listinfo/py-dev