#12493: tol and optional in doctests don't play well together
----------------------------+-----------------------------------------------
   Reporter:  kcrisman      |          Owner:  mvngu        
       Type:  defect        |         Status:  needs_work   
   Priority:  blocker       |      Milestone:  sage-5.0     
  Component:  doctest       |       Keywords:               
Work_issues:                |       Upstream:  N/A          
   Reviewer:  Marco Streng  |         Author:  John Palmieri
     Merged:                |   Dependencies:               
----------------------------+-----------------------------------------------
Changes (by mstreng):

  * status:  needs_review => needs_work
  * reviewer:  => Marco Streng


Comment:

 I think the count is still wrong. I added a print statement to sage-
 doctest that lists the lines and the corresponding modifiers:
 {{{
     print "Printing lines and their modifiers"
     for i in range(len(t)):
         print "\n ========\n line:"
         print t[i]
         print "---\n comment:"
         print comment_modifiers[i]
     print "in total, there were %s lines with %s modifiers" % (len(t),
 len(comment_modifiers))
     print "remaining lines:"
     print t[len(comment_modifiers):]
     print "remaining modifiers:"
     print comment_modifiers[len(t):]
 }}}
 Lines with tol give a mismatch, even with the patch.

 As a consequence, the following file passes all tests with {{{sage -t
 -only-optional=magma}}}, while it should fail!
 {{{
 def dummy():
     """

     Test whether or not optional doctests and `abs tol` get along.


         sage: 1+1 # rel tol 1e-10
         2
         sage: 2+2 # optional - requires magma and is wrong
         1

     """
     pass
 }}}
 (13 lines, 15 modifiers, and the magma modifiers ended up on empty lines
 at the end, hence the pass with {{{-only-optional=magma}}})

 The file fails the test with {{{sage -t -optional}}}, as that runs all
 lines, regardless of modifiers. The file passes the test with {{{sage
 -t}}}.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12493#comment:12>
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