Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix testing of installed rst files #38863

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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'

Check warning on line 290 in src/sage/doctest/control.py

View check run for this annotation

Codecov / codecov/patch

src/sage/doctest/control.py#L290

Added line #L290 was not covered by tests
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
Loading