Skip to content

Commit 1f82f23

Browse files
committed
Fix testing of installed rst files
1 parent 1b3f398 commit 1f82f23

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)