Re: Exception inside loop wrongly failing doctest

2009-06-12 Thread Ben Finney
Steven D'Aprano writes: > Ah, that would be it. Not a bug then, a limitation of the doctest module. The doctest module is good for narrative tests (ensuring that examples in documentation actually work as written), but poor for unit testing. Both functions are useful, but each should use a diff

Re: Exception inside loop wrongly failing doctest

2009-06-12 Thread Steven D'Aprano
Lie Ryan wrote: > Lie Ryan wrote: >> Steven D'Aprano wrote: >>> One of my doctests is failing, and I suspect a bug. ... > it seems that if the expected result is a traceback, the doc result must > starts with the traceback keyword: Ah, that would be it. Not a bug then, a limitation of the doctes

Re: Exception inside loop wrongly failing doctest

2009-06-12 Thread Lie Ryan
Lie Ryan wrote: > Steven D'Aprano wrote: >> One of my doctests is failing, and I suspect a bug. >> >> The test involves matching an exception in a for-loop. Here are two >> simplified versions of the test, both should pass but only the first does. >> > > tell me, what's the result of 1/0? Whooops

Re: Exception inside loop wrongly failing doctest

2009-06-12 Thread Lie Ryan
Steven D'Aprano wrote: > One of my doctests is failing, and I suspect a bug. > > The test involves matching an exception in a for-loop. Here are two > simplified versions of the test, both should pass but only the first does. > tell me, what's the result of 1/0? -- http://mail.python.org/mailma