diff --git a/doc/en/example/multipython.py b/doc/en/example/multipython.py index c06e452df..3dc1d9b29 100644 --- a/doc/en/example/multipython.py +++ b/doc/en/example/multipython.py @@ -2,7 +2,7 @@ module containing a parametrized tests testing cross-python serialization via the pickle module. """ -import distutils.spawn +import shutil import subprocess import textwrap @@ -24,7 +24,7 @@ def python2(request, python1): class Python: def __init__(self, version, picklefile): - self.pythonpath = distutils.spawn.find_executable(version) + self.pythonpath = shutil.which(version) if not self.pythonpath: pytest.skip("{!r} not found".format(version)) self.picklefile = picklefile diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 8c0e4754f..a9f006f24 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -435,15 +435,9 @@ Running it results in some skips if we don't have all the python interpreters in . $ pytest -rs -q multipython.py ssssssssssss......sss...... [100%] - ============================= warnings summary ============================= - $PYTHON_PREFIX/lib/python3.6/distutils/__init__.py:1 - $PYTHON_PREFIX/lib/python3.6/distutils/__init__.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses - import imp - - -- Docs: https://docs.pytest.org/en/latest/warnings.html ========================= short test summary info ========================== SKIPPED [15] $REGENDOC_TMPDIR/CWD/multipython.py:30: 'python3.5' not found - 12 passed, 15 skipped, 1 warnings in 0.12 seconds + 12 passed, 15 skipped in 0.12 seconds Indirect parametrization of optional implementations/imports --------------------------------------------------------------------