#8708: allow doctest script to handle docstrings with triple single quotes
---------------------------+------------------------------------------------
   Reporter:  mvngu        |          Owner:  tbd                         
       Type:  enhancement  |         Status:  needs_review                
   Priority:  minor        |      Milestone:  sage-4.7.2                  
  Component:  doctest      |       Keywords:                              
Work_issues:               |       Upstream:  N/A                         
   Reviewer:               |         Author:  Burcin Erocal, John Palmieri
     Merged:               |   Dependencies:                              
---------------------------+------------------------------------------------
Changes (by newvalueoldvalue):

  * author:  Burcin Erocal => Burcin Erocal, John Palmieri


Comment:

 This doesn't work for me: it skips all doctests in a typical file.  The
 issue is the line
 {{{
 min_ind = min(dq_ind, sq_ind)
 }}}
 which means that if either (not just both) search fails, then `min_ind` is
 `-1`, so the loop exits.

 I also don't think we need to modify `doc_prefix` and `doc_suffix`, since
 this is part of the string written to the temporary doctesting file.  Do
 the triple quotes in that file have to match the original ones, or can
 they all be `"""`?

 I'm attaching a new patch which uses regular expressions instead, and
 which doesn't modify `doc_prefix` and `doc_suffix`.  I'm also attaching a
 small file for testing purposes; testing on this file should produce three
 failures, and if you add some print statements to the function
 `extract_doc`, it should extract the correct string.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8708#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to