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

2010-07-29 Thread Aahz
In article 4c3ff6f7$0$11101$c3e8...@news.astraweb.com, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: Remember that doctests aren't intended for a comprehensive test suite. WDYM not intended? Disagree with Tim Peters much? ;-) -- Aahz (a...@pythoncraft.com) *

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

2010-07-16 Thread Steven D'Aprano
On Fri, 16 Jul 2010 01:26:40 -0400, python wrote: Thomas, Recall that doctest doesn't parse the code, it extracts the docstrings. And docstrings are just strings, and are parsed like strings. I understand what you're saying, but I'm struggling with how to represent the following strings

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

2010-07-16 Thread Albert Hopkins
On Fri, 2010-07-16 at 01:26 -0400, pyt...@bdurham.com wrote: I understand what you're saying, but I'm struggling with how to represent the following strings in doctest code and doctest results. No matter what combination of backslashes or raw strings I use, I am unable to find a way to code

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

2010-07-16 Thread Thomas Jollans
On 07/16/2010 07:26 AM, pyt...@bdurham.com wrote: Thomas, Recall that doctest doesn't parse the code, it extracts the docstrings. And docstrings are just strings, and are parsed like strings. I understand what you're saying, but I'm struggling with how to represent the following strings

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

2010-07-15 Thread python
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

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

2010-07-15 Thread Thomas Jollans
On 07/15/2010 11:14 PM, pyt...@bdurham.com wrote: 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

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

2010-07-15 Thread python
Thomas, Recall that doctest doesn't parse the code, it extracts the docstrings. And docstrings are just strings, and are parsed like strings. I understand what you're saying, but I'm struggling with how to represent the following strings in doctest code and doctest results. No matter what