doctest with variable return value
3KWA
eugene at boardkulture.com
Wed Jul 26 02:05:25 EDT 2006
Peter Otten wrote:
> You cannot test for an unknown value, but you can do some sanity checks:
>
> >>> rate = get_rate('AUDEUR')
> >>> rate > 0
> True
> >>> isinstance(rate, float)
> True
>
> This will at least make sure that get_rate() does not throw an exception.
Thanks a lot ... sanity checks ... it makes a lot of sense to me!
At EuroPython I attended a talk where someone said that untested code
is nothing ... so I am trying to write something instead of nothing ...
on the other hand can code ever be over tested?
EuGeNe
More information about the Python-list
mailing list