Re: Case study: debugging failed assertRaises bug

2011-04-27 Thread R David Murray
Ben Finney benfinney.id.au> writes: > > (1) assertRaises REALLY needs a better error message. If not a custom > > message, at least it should show the result it got instead of an > > exception. > > +1 > > Is this one of the many improvements in Python 3.2's ‘unittest’ that > Michael Foord presid

Re: Case study: debugging failed assertRaises bug

2011-04-26 Thread Ben Finney
Steven D'Aprano writes: > I've just spent two hours banging my head against what I *thought* > (wrongly!) was a spooky action-at-a-distance bug in unittest, so I > thought I'd share it with anyone reading. Much appreciated. I am experiencing a tear-my-hair-out test failure which sounds exactly

Re: Case study: debugging failed assertRaises bug

2011-04-26 Thread Raymond Hettinger
On Apr 25, 11:05 pm, Steven D'Aprano wrote: > I've just spent two hours banging my head against what I *thought* > (wrongly!) was a spooky action-at-a-distance bug in unittest, so I > thought I'd share it with anyone reading. Thanks for telling your story. I'm sure the lessons learned will be hel

Re: Case study: debugging failed assertRaises bug

2011-04-26 Thread Duncan Booth
Steven D'Aprano wrote: > (1) assertRaises REALLY needs a better error message. If not a custom > message, at least it should show the result it got instead of an > exception. > If a different exception was thrown then you get an error instead of a failure and you are shown the Exception that

Case study: debugging failed assertRaises bug

2011-04-25 Thread Steven D'Aprano
I've just spent two hours banging my head against what I *thought* (wrongly!) was a spooky action-at-a-distance bug in unittest, so I thought I'd share it with anyone reading. I have a unit test which I inherit from a mixin class that looks something like this: def testBadArgType(self):