Skip to content

Commit b08503c

Browse files
author
Release Manager
committed
sagemathgh-38863: Fix testing of installed rst files 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
2 parents 002c38e + 1f82f23 commit b08503c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sage/doctest/control.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,14 @@ def skipfile(filename, tested_optional_tags=False, *,
282282
sage: skipfile(filename, True)
283283
False
284284
"""
285-
if filename.endswith('.rst.txt'):
286-
ext = '.rst.txt'
287285
if filename.endswith('__main__.py'):
288286
if log:
289287
log(f"Skipping '{filename}' because it is a __main__.py file")
290288
return True
291-
_ , ext = os.path.splitext(filename)
289+
if filename.endswith('.rst.txt'):
290+
ext = '.rst.txt'
291+
else:
292+
_ , ext = os.path.splitext(filename)
292293
# .rst.txt appear in the installed documentation in subdirectories named "_sources"
293294
if ext not in ('.py', '.pyx', '.pxd', '.pxi', '.sage', '.spyx', '.rst', '.tex', '.rst.txt'):
294295
if log:

0 commit comments

Comments
 (0)