aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2018-03-05 17:01:48 -0500
committerJason R. Coombs <jaraco@jaraco.com>2018-03-05 17:01:48 -0500
commite4da2275b57335c5ea2574b728c926eeefe6875c (patch)
treed3a8a690de9b28f1da2a038a09aee270982cf3a4
parent0a6264dc11a7c692f2444825da2bf91078dcb118 (diff)
downloadexternal_python_setuptools-e4da2275b57335c5ea2574b728c926eeefe6875c.tar.gz
external_python_setuptools-e4da2275b57335c5ea2574b728c926eeefe6875c.tar.bz2
external_python_setuptools-e4da2275b57335c5ea2574b728c926eeefe6875c.zip
Skip tests in test_virtualenv if the prefix is broken on that virtualenv. Ref #1284.
-rw-r--r--setuptools/tests/test_virtualenv.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py
index eea11652..b66a311d 100644
--- a/setuptools/tests/test_virtualenv.py
+++ b/setuptools/tests/test_virtualenv.py
@@ -2,6 +2,7 @@ import glob
import os
import sys
+import pytest
from pytest import yield_fixture
from pytest_fixture_config import yield_requires_config
@@ -11,6 +12,20 @@ from .textwrap import DALS
from .test_easy_install import make_nspkg_sdist
+@pytest.fixture(autouse=True)
+def pytest_virtualenv_works(virtualenv):
+ """
+ pytest_virtualenv may not work. if it doesn't, skip these
+ tests. See #1284.
+ """
+ venv_prefix = virtualenv.run(
+ 'python -c "import sys; print(sys.prefix)"',
+ capture=True,
+ ).strip()
+ if venv_prefix == sys.prefix:
+ pytest.skip("virtualenv is broken (see pypa/setuptools#1284)")
+
+
@yield_requires_config(pytest_virtualenv.CONFIG, ['virtualenv_executable'])
@yield_fixture(scope='function')
def bare_virtualenv():