Skip to content

Commit a61da7f

Browse files
committed
No filenamrs is equivalent to src/sage
1 parent 5a42152 commit a61da7f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/bin/sage-runtests

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,17 @@ if __name__ == "__main__":
171171
pytest_options = []
172172
if args.verbose:
173173
pytest_options.append("-v")
174-
# #31924: Do not run pytest on individual Python files unless
175-
# they match the pytest file pattern. However, pass names
176-
# of directories. We use 'not os.path.isfile(f)' for this so that
177-
# we do not silently hide typos.
178-
filenames = [f for f in args.filenames
179-
if f.endswith("_test.py") or not os.path.isfile(f)]
174+
175+
# #35999: no filenames in arguments is equivalent to "src/sage"
176+
if not args.filenames:
177+
filenames = [os.path.join(os.environ.get('SAGE_SRC'), "sage")]
178+
else:
179+
# #31924: Do not run pytest on individual Python files unless
180+
# they match the pytest file pattern. However, pass names
181+
# of directories. We use 'not os.path.isfile(f)' for this so that
182+
# we do not silently hide typos.
183+
filenames = [f for f in args.filenames
184+
if f.endswith("_test.py") or not os.path.isfile(f)]
180185
if filenames:
181186
print(f"Running pytest on {filenames} with options {pytest_options}")
182187
exit_code_pytest = pytest.main(filenames + pytest_options)

0 commit comments

Comments
 (0)