
About a month and a half ago, I filed several patches for doctest, and they haven't gotten any comments; so I was wondering if anyone could look at them. The most interesting is #933238, which addresses the often-noted problem that doctest can't handle blank lines. It adds a special blank-line marker (currently "-"), which must be *dedented* with respect to the doctest block. Here's an example use (the "x"s are to prevent mail readers from interpreting ">>>" as a quotation). x def test_blankline_marker(): x r""" x Use a dedented "-" to signify a blank line: x x >>> print 'First line\n\nThis is after a blank line\n' x First line x - x This is after a blank line x - x """ (Note that both internal and trailing blank lines can be handled.) This change is backwards compatible, since currently any line in a doctest block that's dedented past the prompt (">>>") is an error. If anyone has time to take a look at this, let me know what you think. Thanks. -Edward My doctest patches: [ 933238 ] doctest: add a special (dedented) marker for blank lines http://sourceforge.net/tracker/?func=detail&aid=933238&group_id=5470&atid=305470 [ 932930 ] doctest: suggest the use of rawstrings for backslashes http://sourceforge.net/tracker/?func=detail&aid=932930&group_id=5470&atid=305470 [ 932935 ] doctest: allow custom matchers for testing if got==want http://sourceforge.net/tracker/?func=detail&aid=932935&group_id=5470&atid=305470 [ 932932 ] doctest: Add Tester params to DocTestSuite http://sourceforge.net/tracker/?func=detail&aid=932932&group_id=5470&atid=305470

Edward Loper wrote:
About a month and a half ago, I filed several patches for doctest, and they haven't gotten any comments; so I was wondering if anyone could look at them.
It is not surprising the patches haven't seen any comments: We get way more patches than we can handle these days. If you want to help, please review patches of other people, and recommend adaption or rejection. (Once I pondered requiring people to review 10 patches before reviewing one of theirs) In case of your first patch, there is an added difficulty that the introductory text is so long it shys reviewers away: If you 10 minutes to read *just* the explanation what the patch does, you know that it will take several hours to deal with the entire patch. Of course, a quick review shows that the patches are formally incomplete, so I did not need to look further. Regards, Martin

[Edward Loper]
About a month and a half ago, I filed several patches for doctest, and they haven't gotten any comments; so I was wondering if anyone could look at them.
Jim Fulton and I intend to do some doctest work for 2.4, so feel free to assign them to me. I can't make time for it immediately, though.
The most interesting is #933238, which addresses the often-noted problem that doctest can't handle blank lines. It adds a special blank-line marker (currently "-"), which must be *dedented* with respect to the doctest block.
Fair warning that any gimmick weakening doctest's WYSIWYG guarantee is going to be a hard sell if I'm the reviewer. The business about blank lines is a documented limitation of the design. Limitations can indeed create problems, but removing them can create other problems. Making a doctest reader learn a special "doctest markup language" is A Problem in this case. Offhand, I'd be happier with an almost-self-evident (say) <blank line> marker than with a cryptic _ "you have no hope of guessing what this means unless you scour the docs" marker. Dedenting is a clever idea, BTW.
participants (3)
-
"Martin v. Löwis"
-
Edward Loper
-
Tim Peters