Ticket #12991 (closed enhancement: fixed)

Opened 12 months ago

Last modified 12 months ago

Don't doctest autogenerated rst files

Reported by: jhpalmieri Owned by: mvngu
Priority: minor Milestone: sage-5.1
Component: doctest coverage Keywords:
Cc: Work issues:
Report Upstream: N/A Reviewers: Keshav Kini
Authors: John Palmieri Merged in: sage-5.1.beta2
Dependencies: Stopgaps:

Description (last modified by kini) (diff)

When we build the Sage documentation, we create lots of files which look like the following (SAGE_ROOT/devel/sage/doc/en/reference/sage/algebras/free_algebra_quotient_element.rst):

.. _sage.algebras.free_algebra_quotient_element:

Free algebra quotient elements
==============================

.. This file has been autogenerated.


.. automodule:: sage.algebras.free_algebra_quotient_element
   :members:
   :undoc-members:
   :show-inheritance:

When we run make ptestlong, these files get doctested. I don't think there is a good reason for this: we should skip these files when doctesting. There are two ways of doing this: patch the doctesting scripts to skip files containing \n.. This file has been autogenerated.\n, or write .. nodoctest as the first line of each of these files. The attached patch does the second of these (a patch to do the first is given in a comment below).

Attachments

trac_12991-doctest.patch Download (794 bytes) - added by jhpalmieri 12 months ago.

Change History

Changed 12 months ago by jhpalmieri

comment:1 Changed 12 months ago by kini

  • Description modified (diff)

comment:2 Changed 12 months ago by jhpalmieri

  • Status changed from new to needs_review

For the first approach, apply a patch like this to SAGE_ROOT/local/bin:

  • sage-ptest

    diff --git a/sage-ptest b/sage-ptest
    a b def skip(F): 
    133133        sys.stdout.flush() 
    134134        printmutex.release() 
    135135        return True 
     136    TEXT = open(G).read() 
    136137    filenm = os.path.split(F)[1] 
    137138    if (filenm[0] == '.' or (os.path.sep + '.' in G.lstrip(os.path.sep + '.')) 
    138         or 'nodoctest' in open(G).read()[:50]): 
     139        or 'nodoctest' in TEXT[:50] 
     140        or '\n.. This file has been autogenerated.\n' in TEXT): 
    139141        return True 
    140142    if G.find(os.path.join('doc', 'output')) != -1: 
    141143        return True 

comment:3 Changed 12 months ago by kini

  • Status changed from needs_review to positive_review
  • Reviewers set to Keshav Kini
  • Authors set to John Palmieri

The approach of your patch (rather than your comment) seems to me to be the correct one. It also passes tests on 5.0.beta1, and the code looks reasonable, so positive review from me.

comment:4 Changed 12 months ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-5.1.beta2
Note: See TracTickets for help on using tickets.