On Thu, 16 Dec 2010 at 09:12PM -0800, Justin C. Walker wrote:
> I have a doctest that results in a long (400-byte) string of output.
> Is there a simple way to tell the doctest code to ignore whitespace
> (in particular, newlines) when comparing output? I don't think putting
> that output in the file is a reasonable thing to do, but I don't want
> to jump through hoops for this either.

AFAIK, the doctest framework always does straight string comparison to
check if the test passes, so if you want to ignore newlines, you should
do something like .replace('\n', '') to your output. Is it possible to
do str() to your function so you get a plain string to work with?

Dan

--
---  Dan Drake
-----  http://mathsci.kaist.ac.kr/~drake
-------

Attachment: signature.asc
Description: Digital signature

Reply via email to