#14290: Running doctests from within Sage doesn't work
-----------------------------+----------------------------------------------
       Reporter:  roed       |         Owner:  mvngu          
           Type:  defect     |        Status:  positive_review
       Priority:  major      |     Milestone:  sage-5.9       
      Component:  doctest    |    Resolution:                 
       Keywords:             |   Work issues:                 
Report Upstream:  N/A        |     Reviewers:  Volker Braun   
        Authors:  David Roe  |     Merged in:                 
   Dependencies:  #12415     |      Stopgaps:                 
-----------------------------+----------------------------------------------
Changes (by roed):

  * status:  needs_review => positive_review


Old description:

> Running doctests from within Sage results in any test that has output
> failing.  For example:
>
> {{{
> sage: run_doctests(sage.algebras.algebra)
> Doctesting
> /Users/roed/sage/sage-5.9.beta0/devel/sage/sage/algebras/algebra.py
> Running doctests with ID 2013-03-17-01-02-17-09f21e8e.
> Doctesting 1 file.
> sage -t
> /Users/roed/sage/sage-5.9.beta0/devel/sage/sage/algebras/algebra.py
> **********************************************************************
> File
> "/Users/roed/sage/sage-5.9.beta0/devel/sage/sage/algebras/algebra.py",
> line 29, in sage.algebras.algebra.is_Algebra
> Failed example:
>     is_Algebra(R)
> Expected:
>     True
> Got:
>     True
> **********************************************************************
> File
> "/Users/roed/sage/sage-5.9.beta0/devel/sage/sage/algebras/algebra.py",
> line 31, in sage.algebras.algebra.is_Algebra
> Failed example:
>     sig_on_count()
> Expected:
>     0
> Got:
>     0
> **********************************************************************
> 1 item had failures:
>    2 of   4 in sage.algebras.algebra.is_Algebra
>     [3 tests, 2 failures, 0.1 s]
> ----------------------------------------------------------------------
> sage -t
> /Users/roed/sage/sage-5.9.beta0/devel/sage/sage/algebras/algebra.py  # 2
> doctests failed
> ----------------------------------------------------------------------
> Total time for all tests: 0.1 seconds
>     cpu time: 0.1 seconds
>     cumulative wall time: 0.1 seconds
> }}}
>
> This is the result of IPython coloring the output.

New description:

 Running doctests from within Sage results in any test that has output
 failing.  For example:

 {{{
 sage: run_doctests(sage.algebras.algebra)
 Doctesting
 /Users/roed/sage/sage-5.9.beta0/devel/sage/sage/algebras/algebra.py
 Running doctests with ID 2013-03-17-01-02-17-09f21e8e.
 Doctesting 1 file.
 sage -t
 /Users/roed/sage/sage-5.9.beta0/devel/sage/sage/algebras/algebra.py
 **********************************************************************
 File
 "/Users/roed/sage/sage-5.9.beta0/devel/sage/sage/algebras/algebra.py",
 line 29, in sage.algebras.algebra.is_Algebra
 Failed example:
     is_Algebra(R)
 Expected:
     True
 Got:
     True
 **********************************************************************
 File
 "/Users/roed/sage/sage-5.9.beta0/devel/sage/sage/algebras/algebra.py",
 line 31, in sage.algebras.algebra.is_Algebra
 Failed example:
     sig_on_count()
 Expected:
     0
 Got:
     0
 **********************************************************************
 1 item had failures:
    2 of   4 in sage.algebras.algebra.is_Algebra
     [3 tests, 2 failures, 0.1 s]
 ----------------------------------------------------------------------
 sage -t
 /Users/roed/sage/sage-5.9.beta0/devel/sage/sage/algebras/algebra.py  # 2
 doctests failed
 ----------------------------------------------------------------------
 Total time for all tests: 0.1 seconds
     cpu time: 0.1 seconds
     cumulative wall time: 0.1 seconds
 }}}

 This is the result of IPython coloring the output.

 Apply

 * [attachment:14290.patch]
 * [attachment:trac_14290_ansi_escapes_indication.patch]

--

Comment:

 Your patch looks good too.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14290#comment:4>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to