Skip to content

Commit 4adecd8

Browse files
author
Release Manager
committed
gh-36836: `sage --tox`, `sage --pytest`: Stop fallthrough when `tox`, `pytest` are not installed (yet) <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> When `pytest` is not installed, ``` $ ./sage -pytest src/sage/tests/memcheck git:sage_tests_memcheck_optional Run 'sage -i pytest' to install /Users/mkoeppe/s/sage/sage-rebasing/worktree- clean/local/var/lib/sage/venv-python3.9/bin/python3: can't find '__main__' module in '/Users/mkoeppe/s/sage/sage-rebasing/worktree- clean/src/sage/tests/memcheck' ``` Here we add the missing error exit. Likewise for `sage --tox`. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36836 Reported by: Matthias Köppe Reviewer(s): Dima Pasechnik
2 parents 44a0d2d + 4c140c1 commit 4adecd8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/bin/sage

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,7 @@ if [ "$1" = '-tox' -o "$1" = '--tox' ]; then
10031003
exec tox -c "$SAGE_SRC" "$@"
10041004
else
10051005
echo "Run 'sage -i tox' to install"
1006+
exit 1
10061007
fi
10071008
else
10081009
echo >&2 "error: Sage source directory or tox.ini not available"
@@ -1024,6 +1025,7 @@ if [ "$1" = '-pytest' -o "$1" = '--pytest' ]; then
10241025
exec pytest --rootdir="$SAGE_SRC" --doctest-modules "$@" "$SAGE_SRC"
10251026
else
10261027
echo "Run 'sage -i pytest' to install"
1028+
exit 1
10271029
fi
10281030
else
10291031
echo >&2 "error: Sage source directory or tox.ini not available"

0 commit comments

Comments
 (0)