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
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
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
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
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.
As a doctest, this passes:
>>> for x in [3, 2, 1]:
... print (x, 1.0/x)
...
(3, 0.33