Opened 11 years ago

Closed 11 years ago

#12704 closed defect (duplicate)

Restore doctesting of non-library files

Reported by: Francis Clarke Owned by: Minh Van Nguyen
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: doctest coverage Keywords:
Cc: John Palmieri Merged in:
Authors: Reviewers: Francis Clarke
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Since #9739, it has not been possible to doctest non-library files (if, as is likely, they contain definitions which get tested). This is because in sage-doctest the same name is used for:

  1. the python file which is created in SAGE_TESTDIR (a copy of, or a preparsed version of, the file being tested), and
  2. the file which loads the previous file and contains the extracted doctests.

As a result, the first file is overwritten by the second, and then loads itself. Thus definitions from the original file are not available to the doctests.

Attachments (1)

trac_12704-doctest_non-library_files.patch (630 bytes) - added by Francis Clarke 11 years ago.

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by Francis Clarke

comment:1 Changed 11 years ago by Francis Clarke

Authors: Francis Clarke
Status: newneeds_review

The one-line patch solves the problem.

comment:2 Changed 11 years ago by John Palmieri

I think this is a duplicate of #12069.

comment:3 in reply to:  2 Changed 11 years ago by Francis Clarke

Milestone: sage-5.0sage-duplicate/invalid/wontfix
Status: needs_reviewpositive_review

Replying to jhpalmieri:

I think this is a duplicate of #12069 .

Indeed, it is; it should be closed.

Sorry for missing #12069, which does a more thorough job. Perhaps it should be added to #11337.

comment:4 Changed 11 years ago by John Palmieri

I just added #12069 to #11337.

comment:5 Changed 11 years ago by Jeroen Demeyer

Authors: Francis Clarke
Resolution: duplicate
Reviewers: Francis Clarke
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.