#12493: tol and optional in doctests don't play well together
---------------------------------+------------------------------------------
       Reporter:  kcrisman       |         Owner:  mvngu       
           Type:  defect         |        Status:  needs_review
       Priority:  blocker        |     Milestone:  sage-5.0    
      Component:  doctest        |    Resolution:              
       Keywords:                 |   Work issues:              
Report Upstream:  N/A            |     Reviewers:  Marco Streng
        Authors:  John Palmieri  |     Merged in:              
   Dependencies:                 |      Stopgaps:              
---------------------------------+------------------------------------------

Comment (by mstreng):

 All tests pass with the patch. But since this changes the doctesting
 framework, I needed to construct a doctest that is supposed to fail, and
 check whether it gives the correct failures. This made me stumble upon
 many problems with tol in doctesting.

 Take this example:
 {{{
 """
 EXAMPLES:

 The name blah is undefined::

     sage: blah+blah
     blahblah

 Here's a doctest that is out of tolerance::

     sage: 100+10000000000 # abs tol 0.1
     10000000000
     sage: 1+1
     2
 """
 }}}
 The output when doctesting is
 {{{
 File "/home/marco/sage-5.0.beta11/small.sage", line 6:
     sage: blah+blah
 Out of tolerance 10000000000.0 vs 10000000100.0
 }}}
 So the out of tolerance is mentioned for the wrong test. And the error of
 the test "blah+blah" is not even listed.

 It gets worse if you remove the part that says
 {{{
     sage: 1+1
     2
 }}}
 Then the python file produced for doctesting has a syntax error due to a
 blank line after the tolerance output.
 {{{
   File "/home/marco/.sage//tmp/small_8271.py", line 63
     ... ''', res, 0.1, 'ab
 }}}
 Any test with tolerance followed by a blank line will produce a syntax
 error and end the doctesting of the whole file.

 I guess I will have to work harder to find a set of doctests that avoids
 these issues, but still adequately tests whether
 [attachment:trac_12493.patch] is a good idea.

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