[Python-3000] [Python-Dev] Need help fixing failing Py3k Unittests in py3k-struni (original) (raw)
Steven Bethard steven.bethard at gmail.com
Wed Jul 11 00:38:53 CEST 2007
- Previous message: [Python-3000] Need help fixing failing Py3k Unittests in py3k-struni
- Next message: [Python-3000] [Python-Dev] Need help fixing failing Py3k Unittests in py3k-struni
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 7/10/07, Christian Heimes <lists at cheimes.de> wrote:
Guido van Rossum wrote: > Please help!
I've made a meta patch that makes debugging the bugs a lot easier. It replaces assert(foo == bar) and failUnless(foo == bar) with failUnlessEqual(foo, bar). failUnlessEqual shows the value of foo and bar when they are not equal. http://www.python.org/sf/1751515 sed -r "s/self.assert((.*)\ ==/self.failUnlessEqual(\1,/" -i *.py sed -r "s/self.failUnless((.*)\ ==/self.failUnlessEqual(\1,/" -i *.py
Some of these look questionable, e.g.:
self.assert_(d == self.spamle or d == self.spambe)
self.failUnlessEqual(d == self.spamle or d, self.spambe)
...
self.assert_((a == 42) is False)
self.failUnlessEqual((a, 42) is False)
I'd probably go with something a little more restrictive, maybe:
r'self.assert_\(\S+ == \S+\)'
Something like that ought to have fewer false positives.
STeVe
I'm not in-sane. Indeed, I am so far out of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy
- Previous message: [Python-3000] Need help fixing failing Py3k Unittests in py3k-struni
- Next message: [Python-3000] [Python-Dev] Need help fixing failing Py3k Unittests in py3k-struni
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]