aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiro Hrončok <miro@hroncok.cz>2017-09-20 14:03:27 +0200
committerMiro Hrončok <miro@hroncok.cz>2017-09-20 14:03:29 +0200
commitee40d9fffac9c13ecfe9a427872adeeaedc57778 (patch)
tree2ac481da61189f3020659cad7a093ba5ee58759e
parent9f295a706590b1e3618978d6f2d83af0b893ec4d (diff)
downloadexternal_python_setuptools-ee40d9fffac9c13ecfe9a427872adeeaedc57778.tar.gz
external_python_setuptools-ee40d9fffac9c13ecfe9a427872adeeaedc57778.tar.bz2
external_python_setuptools-ee40d9fffac9c13ecfe9a427872adeeaedc57778.zip
Tests: Run `python -m pip` instead of plain `pip`
This allows to run the testsuite on systems where `/usr/bin/pip` is a specific Python version, but the tests are run on a different one. For example in Fedora RPM, when the Python 3 tests are invoked, they should use Python 3 pip, not Python 2 `/usr/bin/pip`. Unlike other approaches, like using `pip2`/`pip3` which is currently done in Fedora RPM (downstream patch), this way it Works Everywhere™ and the downstream patch can be dropped. See https://src.fedoraproject.org/rpms/python-setuptools/blob/54eaa03a4dc97f93a5e4c92c55e580a4ab55a058/f/0001-Run-test-on-a-version-specific-pip.patch
-rw-r--r--setuptools/tests/test_develop.py2
-rw-r--r--setuptools/tests/test_namespaces.py6
2 files changed, 8 insertions, 0 deletions
diff --git a/setuptools/tests/test_develop.py b/setuptools/tests/test_develop.py
index ad7cfa05..ec67c798 100644
--- a/setuptools/tests/test_develop.py
+++ b/setuptools/tests/test_develop.py
@@ -167,6 +167,8 @@ class TestNamespaces:
target = tmpdir / 'packages'
# use pip to install to the target directory
install_cmd = [
+ sys.executable,
+ '-m',
'pip',
'install',
str(pkg_A),
diff --git a/setuptools/tests/test_namespaces.py b/setuptools/tests/test_namespaces.py
index 721cad1e..14759e66 100644
--- a/setuptools/tests/test_namespaces.py
+++ b/setuptools/tests/test_namespaces.py
@@ -30,6 +30,8 @@ class TestNamespaces:
targets = site_packages, path_packages
# use pip to install to the target directory
install_cmd = [
+ sys.executable,
+ '-m',
'pip',
'install',
str(pkg_A),
@@ -38,6 +40,8 @@ class TestNamespaces:
subprocess.check_call(install_cmd)
namespaces.make_site_dir(site_packages)
install_cmd = [
+ sys.executable,
+ '-m',
'pip',
'install',
str(pkg_B),
@@ -88,6 +92,8 @@ class TestNamespaces:
target = tmpdir / 'packages'
# use pip to install to the target directory
install_cmd = [
+ sys.executable,
+ '-m',
'pip',
'install',
str(pkg_A),