diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-04-28 12:20:33 +0100 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-05-02 17:13:12 +0100 |
commit | 1bef1e2e793ca59828d7911f702ce05c098c0a74 (patch) | |
tree | c3f4ee08031b94a5633368ea08cf572b15414b75 | |
parent | e94cb204693cee145ea531905dd50b02a26c9f0a (diff) | |
download | python-setuptools-git-1bef1e2e793ca59828d7911f702ce05c098c0a74.tar.gz |
Adequate venv fixtures to the latest change in virtualenv
Since version v20.23.0, `virtualenv` will no longer include `wheel` and
`setuptools` in the created folders.
Some tests in the setuptools test suite assume that these packages are
always present. So we need to adequate these tests.
-rw-r--r-- | setuptools/tests/fixtures.py | 4 | ||||
-rw-r--r-- | setuptools/tests/test_virtualenv.py | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py index 25ab49fd..f1cfc66c 100644 --- a/setuptools/tests/fixtures.py +++ b/setuptools/tests/fixtures.py @@ -105,6 +105,8 @@ def venv(tmp_path, setuptools_wheel): """Virtual env with the version of setuptools under test installed""" env = environment.VirtualEnv() env.root = path.Path(tmp_path / 'venv') + env.create_opts = ['--no-setuptools', '--wheel=bundle'] + # TODO: Use `--no-wheel` when setuptools implements its own bdist_wheel env.req = str(setuptools_wheel) # In some environments (eg. downstream distro packaging), # where tox isn't used to run tests and PYTHONPATH is set to point to @@ -125,7 +127,7 @@ def venv_without_setuptools(tmp_path): """Virtual env without any version of setuptools installed""" env = environment.VirtualEnv() env.root = path.Path(tmp_path / 'venv_without_setuptools') - env.create_opts = ['--no-setuptools'] + env.create_opts = ['--no-setuptools', '--no-wheel'] env.ensure_env() return env diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py index acfe04e9..b17be9ef 100644 --- a/setuptools/tests/test_virtualenv.py +++ b/setuptools/tests/test_virtualenv.py @@ -174,8 +174,8 @@ def _check_test_command_install_requirements(venv, tmpdir): def test_test_command_install_requirements(venv, tmpdir, tmpdir_cwd): - # Ensure pip/wheel packages are installed. - venv.run(["python", "-c", "__import__('pkg_resources').require(['pip', 'wheel'])"]) + # Ensure pip is installed. + venv.run(["python", "-c", "import pip"]) # disable index URL so bits and bobs aren't requested from PyPI with contexts.environment(PYTHONPATH=None, PIP_NO_INDEX="1"): _check_test_command_install_requirements(venv, tmpdir) |