-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure
pip.list_all_versions
works across multiple pip versions
Refs #60085
- Loading branch information
1 parent
1d87bda
commit eaf061a
Showing
2 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sys | ||
|
||
import pytest | ||
from tests.support.helpers import VirtualEnv | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"pip_version", | ||
( | ||
"pip==9.0.3", | ||
"pip<20.0", | ||
"pip<21.0", | ||
"pip>=21.0", | ||
), | ||
) | ||
def test_list_available_packages(modules, pip_version, tmp_path): | ||
if sys.version_info < (3, 6) and pip_version == "pip>=21.0": | ||
pytest.skip("{} is not avaiable on Py3.5".format(pip_version)) | ||
with VirtualEnv(venv_dir=tmp_path, pip_requirement=pip_version) as virtualenv: | ||
virtualenv.install("-U", pip_version) | ||
package_name = "pep8" | ||
available_versions = modules.pip.list_all_versions( | ||
package_name, bin_env=str(virtualenv.venv_bin_dir) | ||
) | ||
assert available_versions |