test_argcomplete: remove usage of `distutils.spawn` (#6703)

Fixes collection error with Python 3.5.3 (Travis):

    testing/test_parseopt.py:2: in <module>
        import distutils.spawn
    .tox/py35-coverage/lib/python3.5/distutils/__init__.py:4: in <module>
        import imp
    .tox/py35-coverage/lib/python3.5/imp.py:33: in <module>
        PendingDeprecationWarning, stacklevel=2)
    E   PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

Build log: https://travis-ci.org/blueyed/pytest/builds/648305304
This commit is contained in:
Daniel Hahler 2020-02-10 11:52:19 +01:00 committed by GitHub
parent 30cb598e9c
commit 449290406c
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import argparse
import distutils.spawn
import os
import shlex
import shutil
import sys
import py
@ -291,7 +291,7 @@ class TestParser:
def test_argcomplete(testdir, monkeypatch):
if not distutils.spawn.find_executable("bash"):
if not shutil.which("bash"):
pytest.skip("bash not available")
script = str(testdir.tmpdir.join("test_argcomplete"))