Possible to include \n chars in doctest code samples or output?

python at bdurham.com python at bdurham.com
Thu Jul 15 17:14:22 EDT 2010


I'm working with some Python 2.6 code that is using the doctest
module for unittests.

I tried adding tests whose code and results required newlines
(\n). Apparently newlines in string constants breaks the doctest
code.

Any workarounds other than using another char for newlines and
wrapping all my strings with .replace( someChar, chr(10) )?

Thanks,
Malcolm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100715/84a87b5f/attachment.html>


More information about the Python-list mailing list