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

Commit 1214e0c

Browse files
author
Matthias Koeppe
committed
src/bin/sage-runtests: Use os.path.isfile, fix ticket number in comment
1 parent 89c7a8e commit 1214e0c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/bin/sage-runtests

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,12 @@ if __name__ == "__main__":
154154
pytest_options = ["--import-mode", "importlib"]
155155
if args.verbose:
156156
pytest_options.append("-v")
157-
# 31914: Do not run pytest on individual Python files unless
158-
# they match the pytest file pattern. However, pass filenames
159-
# without extensions, which are likely directory names.
157+
# #31924: Do not run pytest on individual Python files unless
158+
# they match the pytest file pattern. However, pass names
159+
# of directories. We use 'not os.path.isfile(f)' for this so that
160+
# we do not silently hide typos.
160161
filenames = [f for f in args.filenames
161-
if f.endswith("_test.py") or not os.path.splitext(f)[1]]
162+
if f.endswith("_test.py") or not os.path.isfile(f)]
162163
if filenames or not args.filenames:
163164
exit_code_pytest = pytest.main(pytest_options + filenames)
164165
if exit_code_pytest == 5:

0 commit comments

Comments
 (0)