On 7/10/07, Christian Heimes <[EMAIL PROTECTED]> 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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com