mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Test for candidate ordering
This commit is contained in:
parent
6e3d56897b
commit
d22775819b
1 changed files with 26 additions and 0 deletions
|
@ -1020,3 +1020,29 @@ def test_new_resolver_no_deps_checks_requires_python(script):
|
|||
"{}.{}.{} not in '<2'".format(*sys.version_info[:3])
|
||||
)
|
||||
assert message in result.stderr
|
||||
|
||||
|
||||
def test_new_resolver_prefers_installed_in_upgrade_if_latest(script):
|
||||
create_basic_wheel_for_package(script, "pkg", "1")
|
||||
local_pkg = create_test_package_with_setup(script, name="pkg", version="2")
|
||||
|
||||
# Install the version that's not on the index.
|
||||
script.pip(
|
||||
"install",
|
||||
"--use-feature=2020-resolver",
|
||||
"--no-cache-dir",
|
||||
"--no-index",
|
||||
local_pkg,
|
||||
)
|
||||
|
||||
# Now --upgrade should still pick the local version because it's "better".
|
||||
script.pip(
|
||||
"install",
|
||||
"--use-feature=2020-resolver",
|
||||
"--no-cache-dir",
|
||||
"--no-index",
|
||||
"--find-links", script.scratch_path,
|
||||
"--upgrade",
|
||||
"pkg",
|
||||
)
|
||||
assert_installed(script, pkg="2")
|
||||
|
|
Loading…
Reference in a new issue