#12069: fix doctesting of .sage files
--------------------------+-------------------------------------------------
Reporter: jhpalmieri | Owner: mvngu
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.0
Component: doctest | Keywords: doctest
Work_issues: | Upstream: N/A
Reviewer: | Author: John Palmieri
Merged: | Dependencies:
--------------------------+-------------------------------------------------
Description changed by jhpalmieri:
Old description:
> Trac #9739 broke doctesting of .sage files (as in `sage -t
> my_file.sage`). The attached patch fixes this.
>
> The problem was that before #9739, doctesting `file.sage` produced two
> Python files: a preparsed version of `file.sage`, and a file with the
> doctesting framework and the doctests, but not the actual Python/Sage
> code -- it just included a line like `from file import *`. In #9739, we
> missed this, and we just produced one Python file, the second one, so the
> original Python/Sage code is nowhere to be found, and thus not
> importable. (Actually we produced the preparsed version, but then
> overwrote it with the file containing the doctesting framework.)
>
> I think the same was happening with non-library Python files -- there
> should have been two Python files created, but sage-doctest was creating
> one and then overwriting it. The patch fixes this, too.
>
> At the same time, this patch fixes a small bug in the function
> `delete_tmpfiles`: the function used to quit completely if it couldn't
> find some file in the list `tmpfiles`. Now if if can't find the file, it
> skips it and goes on to the next one.
>
> Apply
>
> - [attachment:trac_12069-doctest.patch] to the scripts repo,
> - [attachment:trac_12069-sage.patch] to the Sage library.
New description:
Trac #9739 broke doctesting of .sage files (as in `sage -t my_file.sage`).
The attached patch fixes this.
The problem was that before #9739, doctesting `file.sage` produced two
Python files: a preparsed version of `file.sage`, and a file with the
doctesting framework and the doctests, but not the actual Python/Sage code
-- it just included a line like `from file import *`. In #9739, we missed
this, and we just produced one Python file, the second one, so the
original Python/Sage code is nowhere to be found, and thus not importable.
(Actually we produced the preparsed version, but then overwrote it with
the file containing the doctesting framework.)
I think the same was happening with non-library Python files -- there
should have been two Python files created, but sage-doctest was creating
one and then overwriting it. The patch fixes this, too.
At the same time, this patch fixes a small bug in the function
`delete_tmpfiles`: the function used to quit completely if it couldn't
find some file in the list `tmpfiles`. Now if it can't find the file, it
skips it and goes on to the next one.
Apply
- [attachment:trac_12069-doctest.patch] to the scripts repo,
- [attachment:trac_12069-sage.patch] to the Sage library.
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12069#comment:5>
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.