[TIP] doctests with either-or outcome

Rob Kirkpatrick robert.d.kirkpatrick at gmail.com
Fri Sep 26 00:51:00 PDT 2008


Hi All,

Is there a way of having a doctest pass if it has EITHER output A or output
B?  In, this case, we need to construct some pickled resources, then use
them for the test.  The first time the resource is generated, it prints out
a "generated resource x..." message.  If the resource already exists, it
generates no output.  Both outputs are ok.  Running the tests twice ensures
that the resources will all be there and no generation messages are printed,
which is what the doctests currently expect, but this seems hacky...

Cheers,
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/testing-in-python/attachments/20080926/b2d2bf2a/attachment.htm 


More information about the testing-in-python mailing list