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

Commit

Permalink
src/tox.ini (pytest): Set --import-mode importlib here, not in src/bi…
Browse files Browse the repository at this point in the history
…n/sage, src/bin/sage-runtests
  • Loading branch information
Matthias Koeppe committed Mar 30, 2022
1 parent 0d9225d commit 05bc58f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/bin/sage
Original file line number Diff line number Diff line change
Expand Up @@ -960,10 +960,10 @@ if [ "$1" = '-pytest' -o "$1" = '--pytest' ]; then
for a in $*; do
case $a in
-*) ;;
*) exec pytest --rootdir="$SAGE_SRC" --import-mode importlib "$@"
*) exec pytest --rootdir="$SAGE_SRC" "$@"
esac
done
exec pytest --rootdir="$SAGE_SRC" --import-mode importlib "$@" "$SAGE_SRC"
exec pytest --rootdir="$SAGE_SRC" "$@" "$SAGE_SRC"
else
echo "Run 'sage -i pytest' to install"
fi
Expand Down
2 changes: 1 addition & 1 deletion src/bin/sage-runtests
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ if __name__ == "__main__":
try:
exit_code_pytest = 0
import pytest
pytest_options = ["--import-mode", "importlib"]
pytest_options = []
if args.verbose:
pytest_options.append("-v")
exit_code_pytest = pytest.main(pytest_options + args.filenames)
Expand Down
1 change: 1 addition & 0 deletions src/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ commands = codespell \
[pytest]
python_files = *_test.py
addopts = --import-mode importlib
[coverage:run]
source = sage
Expand Down

0 comments on commit 05bc58f

Please sign in to comment.