summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Koeppe <mkoeppe@math.ucdavis.edu>2021-11-09 14:53:40 -0800
committerMatthias Koeppe <mkoeppe@math.ucdavis.edu>2021-11-09 14:53:40 -0800
commit802d8723cb8623b0bed230d0e117a372e040fe8e (patch)
tree3ad41bf44e08b08bb178fe1dd662de3394dfb5c6
parent822463194a4720288a2df8c9573d0a1f9726764b (diff)
downloadpython-setuptools-git-802d8723cb8623b0bed230d0e117a372e040fe8e.tar.gz
tox.ini (testenv): Make sure to import setuptools before distutils when invoking pytest
-rw-r--r--tox.ini6
1 files changed, 5 insertions, 1 deletions
diff --git a/tox.ini b/tox.ini
index 8940a182..21fdd866 100644
--- a/tox.ini
+++ b/tox.ini
@@ -12,7 +12,11 @@ deps =
# TODO: remove after Sphinx>4.1.2 is available.
sphinx@git+https://github.com/sphinx-doc/sphinx; python_version>="3.10"
commands =
- pytest {posargs}
+ # We invoke pytest like this to avoid the warning:
+ # UserWarning: Distutils was imported before Setuptools,
+ # but importing Setuptools also replaces the `distutils`
+ # module in `sys.modules`.
+ pytest -c 'import setuptools; import pytest; pytest.main("{posargs}".split())'
usedevelop = True
extras = testing
passenv =