summaryrefslogtreecommitdiff
path: root/setuptools/tests/integration
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2021-11-14 14:08:57 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2021-12-21 02:24:15 +0000
commitc83f83be321a4f6b39460125788cf500459391bb (patch)
tree536f9d3ffe4b011865cf0788b8fde7936e285cbe /setuptools/tests/integration
parent48361da818928e4ffe609878a93a65e9210082dd (diff)
downloadpython-setuptools-git-c83f83be321a4f6b39460125788cf500459391bb.tar.gz
Use shutil to find executable
This is more reliable then simply globing (and will also work in other operating systems)
Diffstat (limited to 'setuptools/tests/integration')
-rw-r--r--setuptools/tests/integration/test_pip_install_sdist.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/setuptools/tests/integration/test_pip_install_sdist.py b/setuptools/tests/integration/test_pip_install_sdist.py
index 68f7f823..e838dd0c 100644
--- a/setuptools/tests/integration/test_pip_install_sdist.py
+++ b/setuptools/tests/integration/test_pip_install_sdist.py
@@ -12,6 +12,7 @@ their build process may require changes in the tests).
"""
import json
import os
+import shutil
import subprocess
import sys
import tarfile
@@ -22,9 +23,9 @@ from urllib.request import urlopen
from zipfile import ZipFile
import pytest
-import setuptools
from packaging.requirements import Requirement
+import setuptools
pytestmark = pytest.mark.integration
@@ -89,7 +90,8 @@ SDIST_OPTIONS = (
@pytest.fixture
def venv_python(tmp_path):
run_command([*VIRTUALENV, str(tmp_path / ".venv")])
- return str(next(tmp_path.glob(".venv/*/python")))
+ possible_path = (str(p.parent) for p in tmp_path.glob(".venv/*/python*"))
+ return shutil.which("python", path=os.pathsep.join(possible_path))
@pytest.fixture(autouse=True)
@@ -221,6 +223,7 @@ def build_deps(package, sdist_file):
deps with `--no-build-isolation`.
"""
import tomli as toml
+
# delay importing, since pytest discovery phase may hit this file from a
# testenv without tomli