From 1f82f2340f7c3e0bcc03c9e2f41320f52760da18 Mon Sep 17 00:00:00 2001 From: Antonio Rojas Date: Sun, 27 Oct 2024 14:37:05 +0100 Subject: [PATCH] Fix testing of installed rst files --- src/sage/doctest/control.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py index f34d3ef5caa..fff35be8307 100644 --- a/src/sage/doctest/control.py +++ b/src/sage/doctest/control.py @@ -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: