Ticket #12991 (closed enhancement: fixed)
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
Change History
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): 133 133 sys.stdout.flush() 134 134 printmutex.release() 135 135 return True 136 TEXT = open(G).read() 136 137 filenm = os.path.split(F)[1] 137 138 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): 139 141 return True 140 142 if G.find(os.path.join('doc', 'output')) != -1: 141 143 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.

