File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -171,12 +171,17 @@ if __name__ == "__main__":
171
171
pytest_options = []
172
172
if args.verbose:
173
173
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)]
180
185
if filenames:
181
186
print(f"Running pytest on {filenames} with options {pytest_options}")
182
187
exit_code_pytest = pytest.main(filenames + pytest_options)
You can’t perform that action at this time.
0 commit comments