Commit e4da2275 authored by Jason R. Coombs's avatar Jason R. Coombs

Skip tests in test_virtualenv if the prefix is broken on that virtualenv. Ref #1284.

parent 0a6264dc
......@@ -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():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment