Skip to content

Commit

Permalink
sagemathgh-38863: Fix testing of installed rst files
Browse files Browse the repository at this point in the history
    
Fix a regression from sagemath#36524 where
`sage -t` skips doctesting installed `rst` files (which get installed as
`rst.txt`)
    
URL: sagemath#38863
Reported by: Antonio Rojas
Reviewer(s): Tobias Diez
  • Loading branch information
Release Manager committed Nov 2, 2024
2 parents 002c38e + 1f82f23 commit b08503c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sage/doctest/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,14 @@ def skipfile(filename, tested_optional_tags=False, *,
sage: skipfile(filename, True)
False
"""
if filename.endswith('.rst.txt'):
ext = '.rst.txt'
if filename.endswith('__main__.py'):
if log:
log(f"Skipping '{filename}' because it is a __main__.py file")
return True
_ , ext = os.path.splitext(filename)
if filename.endswith('.rst.txt'):
ext = '.rst.txt'
else:
_ , ext = os.path.splitext(filename)
# .rst.txt appear in the installed documentation in subdirectories named "_sources"
if ext not in ('.py', '.pyx', '.pxd', '.pxi', '.sage', '.spyx', '.rst', '.tex', '.rst.txt'):
if log:
Expand Down

0 comments on commit b08503c

Please sign in to comment.