doctest and exposing internals.

Neil Cerutti horpner at yahoo.com
Fri Oct 20 23:17:48 CEST 2006


On 2006-10-20, Gabriel Genellina <gagsl-py at yahoo.com.ar> wrote:
> At Friday 20/10/2006 16:29, Neil Cerutti wrote:
>>The example of correct usage it what's wrong with the
>>docstring.
>>
>>There's no interface for checking if an event is queued in Glk,
>>so I resorted to exposing the internal state main.char_request
>>in the doc string. What are the alternatives?
>
> - what you have done

I haven't fully absorbed soapbox section of the doctest manual;
it cautions against doing what I'm doing, i.e., trying to put
complete test coverage in my docstrings. 

> - modify the interfase to allow that kind of checking

Fortunately, I don't control the specification. ;-)

> - use a standard unit test

I'm making some progress in removing the boilerplate from the
doctests by supplying globs to the testmod function.

Thanks for your suggestion.

--
Neil Cerutti



More information about the Python-list mailing list