diff --git a/src/bin/sage b/src/bin/sage index cd91656e1ea..e94cc50940e 100755 --- a/src/bin/sage +++ b/src/bin/sage @@ -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 diff --git a/src/bin/sage-runtests b/src/bin/sage-runtests index 3022e446fee..14ebf4b6b96 100755 --- a/src/bin/sage-runtests +++ b/src/bin/sage-runtests @@ -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) diff --git a/src/tox.ini b/src/tox.ini index d68df4848bd..92f31602ba7 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -156,6 +156,7 @@ commands = codespell \ [pytest] python_files = *_test.py +addopts = --import-mode importlib [coverage:run] source = sage