Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 89c7a8e

Browse files
author
Matthias Koeppe
committed
src/bin/sage-runtests: Do not run pytest on *.pyx, *.pxd, *.rst, etc.
1 parent 1414bc8 commit 89c7a8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/sage-runtests

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ if __name__ == "__main__":
155155
if args.verbose:
156156
pytest_options.append("-v")
157157
# 31914: Do not run pytest on individual Python files unless
158-
# they match the pytest file pattern
158+
# they match the pytest file pattern. However, pass filenames
159+
# without extensions, which are likely directory names.
159160
filenames = [f for f in args.filenames
160-
if f.endswith("_test.py") or not f.endswith(".py")]
161+
if f.endswith("_test.py") or not os.path.splitext(f)[1]]
161162
if filenames or not args.filenames:
162163
exit_code_pytest = pytest.main(pytest_options + filenames)
163164
if exit_code_pytest == 5:

0 commit comments

Comments
 (0)