[Patches] [ python-Patches-407764 ] allow whitespace lines for doctest tests

nobody nobody@sourceforge.net
Sun, 11 Mar 2001 13:40:12 -0800


Patches #407764, was updated on 2001-03-11 13:37
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=407764&group_id=5470

Category: library
Group: None
Status: Open
Priority: 5
Submitted By: Trent Mick
Assigned to: Tim Peters
Summary: allow whitespace lines for doctest tests

Initial Comment:
Currently doctest.py does not allow individual tests 
to have all-whitespace output lines. This patch 
proposes a fix for this. With this patch a leading '.' 
on a doctest output line, if and only if the tests are 
indented, will signal that following whitespace *is* 
the expected output. 

For example, currently this cannot be doctest'ed

"""
    >>> print "\nhello\n"

    hello

    >>>
"""

But with this patch *this* can be:

# file test_doctest.py
"""
    >>> print "\nhello\n"
.
    hello
.
    >>>
"""
def _test():
    import doctest, test_doctest
    return doctest.testmod(test_doctest)
if __name__ == "__main__":
    _test()




----------------------------------------------------------------------

Comment By: Trent Mick
Date: 2001-03-11 13:40

Message:
Logged In: YES 
user_id=34892

Grrr, the code I put in the comment is supposed to be 
indented of course. I will attach the test_doctest.py to 
clarify.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=407764&group_id=5470