<div dir="ltr"><div class="gmail_extra"><font face="verdana, sans-serif"><br></font><div class="gmail_quote"><font face="verdana, sans-serif">On Fri, Dec 4, 2015 at 2:32 PM, Peter Cock <span dir="ltr"><<a href="mailto:p.j.a.cock@googlemail.com" target="_blank">p.j.a.cock@googlemail.com</a>></span> wrote:<br></font><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":5xr" class="" style="overflow:hidden"><font face="verdana, sans-serif">When you have potentially escaped characters in a doctest,<br>
you may have to make the entire docstring a raw string, i.e.<br>
<br>
r"""The first line<br>
<br>
More text here including the doctest.<br>
"""<br>
<br>
See for example the format method in <span class="">Bio</span>/SeqRecord.py where<br>
we do this to handle a new line character.<br>
<br>
Another option here could be to change the code to produce<br>
space aligned __str__ output? Ask Eric first though.</font></div></blockquote></div><font face="verdana, sans-serif"><br><div class="gmail_default" style="display:inline">Just an FYI, </div>doctest has an option NORMALIZE_WHITESPACE<br><a href="https://docs.python.org/3.5/library/doctest.html#doctest.NORMALIZE_WHITESPACE">https://docs.python.org/3.5/library/doctest.html#doctest.NORMALIZE_WHITESPACE</a><br><div class="gmail_default" style="display:inline">"</div><span style="line-height:22.4px;text-align:justify">When specified, all sequences of whitespace (blanks and newlines) are treated as equal. Any sequence of whitespace within the expected output will match any sequence of whitespace within the actual output. By default, whitespace must match exactly. </span><a class="" href="https://docs.python.org/3.5/library/doctest.html#doctest.NORMALIZE_WHITESPACE" title="doctest.NORMALIZE_WHITESPACE" style="color:rgb(99,99,187);text-decoration:none;line-height:22.4px;text-align:justify"><code class="" style="padding:0px 1px;border-radius:3px;background-color:transparent"><span class="">NORMALIZE_WHITESPACE</span></code></a><span style="line-height:22.4px;text-align:justify"> is especially useful when a line of expected output is very long, and you want to wrap it across multiple lines in your source.<div class="gmail_default" style="display:inline">"</div></span></font></div><div class="gmail_extra"><font face="verdana, sans-serif"><span style="line-height:22.4px;text-align:justify"><div class="gmail_default" style="display:inline"></div></span><br clear="all"></font><div><div class="gmail_signature"><div><font face="verdana, sans-serif">Vincent Davis</font></div><div><font face="verdana, sans-serif">720-301-3003</font><span></span><span></span></div></div></div>
</div></div>