Opened 7 years ago

Closed 7 years ago

#12704 closed defect (duplicate)

Restore doctesting of non-library files

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

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 fwclarke 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by fwclarke

comment:1 Changed 7 years ago by fwclarke

  • Authors set to Francis Clarke
  • Status changed from new to needs_review

The one-line patch solves the problem.

comment:2 follow-up: Changed 7 years ago by jhpalmieri

I think this is a duplicate of #12069.

comment:3 in reply to: ↑ 2 Changed 7 years ago by fwclarke

  • Milestone changed from sage-5.0 to sage-duplicate/invalid/wontfix
  • Status changed from needs_review to positive_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 7 years ago by jhpalmieri

I just added #12069 to #11337.

comment:5 Changed 7 years ago by jdemeyer

  • Authors Francis Clarke deleted
  • Resolution set to duplicate
  • Reviewers set to Francis Clarke
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.