1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Update YAML tests for resolver changes

This commit is contained in:
Pradyun Gedam 2020-10-30 06:57:15 +05:30
parent 6f26fb9fee
commit ec9bb10922
No known key found for this signature in database
GPG key ID: FF99710C4332258E
13 changed files with 23 additions and 23 deletions

View file

@ -27,7 +27,7 @@ def generate_yaml_tests(directory):
base = data.get("base", {})
cases = data["cases"]
for resolver in 'old', 'new':
for resolver in 'legacy', '2020-resolver':
for i, case_template in enumerate(cases):
case = base.copy()
case.update(case_template)
@ -39,7 +39,7 @@ def generate_yaml_tests(directory):
case[":resolver:"] = resolver
skip = case.pop("skip", False)
assert skip in [False, True, 'old', 'new']
assert skip in [False, True, 'legacy', '2020-resolver']
if skip is True or skip == resolver:
case = pytest.param(case, marks=pytest.mark.xfail)
@ -84,11 +84,11 @@ def convert_to_dict(string):
return retval
def handle_request(script, action, requirement, options, new_resolver=False):
def handle_request(script, action, requirement, options, resolver_variant):
if action == 'install':
args = ['install']
if new_resolver:
args.append("--use-feature=2020-resolver")
if resolver_variant == "legacy":
args.append("--use-deprecated=legacy-resolver")
args.extend(["--no-index", "--find-links",
path_to_url(script.scratch_path)])
elif action == 'uninstall':
@ -183,7 +183,7 @@ def test_yaml_based(script, case):
effect = handle_request(script, action,
request[action],
request.get('options', '').split(),
case[':resolver:'] == 'new')
resolver_variant=case[':resolver:'])
result = effect['result']
if 0: # for analyzing output easier

View file

@ -37,4 +37,4 @@ cases:
- A 1.0.0
- B 1.0.0
- C 1.0.0
skip: old
skip: legacy

View file

@ -12,7 +12,7 @@ cases:
- error:
code: 0
stderr: ['incompatible']
skip: old
skip: legacy
# -- a good error message would be:
# A 1.0.0 has incompatible requirements B==1.0.0, B==2.0.0
@ -22,7 +22,7 @@ cases:
response:
- state:
- B 1.0.0
skip: old
skip: legacy
# -- old error:
# Double requirement given: B (already in B==1.0.0, name='B')
@ -36,7 +36,7 @@ cases:
stderr: >-
Cannot install B==1.0.0 and B==2.0.0 because these
package versions have conflicting dependencies.
skip: old
skip: legacy
# -- currently the (new resolver) error message is:
# Could not find a version that satisfies the requirement B==1.0.0
# Could not find a version that satisfies the requirement B==2.0.0
@ -55,7 +55,7 @@ cases:
error:
code: 1
stderr: 'no\s+matching\s+distribution'
skip: old
skip: legacy
# -- currently (new resolver) error message is:
# Could not find a version that satisfies the requirement B==1.5.0
# No matching distribution found for b
@ -71,7 +71,7 @@ cases:
error:
code: 1
stderr: 'no\s+matching\s+distribution'
skip: old
skip: legacy
# -- currently the error message is:
# Could not find a version that satisfies the requirement A==2.0
# No matching distribution found for a

View file

@ -25,4 +25,4 @@ cases:
stderr: >-
Cannot install six<1.12 and virtualenv 20.0.2 because these
package versions have conflicting dependencies.
skip: old
skip: legacy

View file

@ -11,7 +11,7 @@ cases:
- install: A
response:
- state: null
skip: old
skip: legacy
# -- currently the error message is:
# Could not find a version that satisfies the requirement C==2.0.0 (from a)
# Could not find a version that satisfies the requirement C==1.0.0 (from b)

View file

@ -16,4 +16,4 @@ cases:
versions have conflicting dependencies.
# TODO: Tweak this error message to make sense.
# https://github.com/pypa/pip/issues/8495
skip: old
skip: legacy

View file

@ -15,4 +15,4 @@ cases:
- error:
code: 0
stderr: ['c==1\.0\.0', 'incompatible']
skip: old
skip: legacy

View file

@ -39,7 +39,7 @@ cases:
- D 1.0.0
- E 1.0.0
- F 1.0.0
skip: old
skip: legacy
-
request:
- install: D[extra_1]

View file

@ -17,4 +17,4 @@ cases:
# the old resolver tries to install A 1.0.0 (which fails), but the new
# resolver realises that A 1.0.0 cannot be installed and falls back to
# installing the older version A 0.8.0 instead.
skip: old
skip: legacy

View file

@ -251,7 +251,7 @@ cases:
- idna 2.7
- pycparser 2.18
- six 1.11.0
skip: old
skip: legacy
-
request:
- install: cachecontrol
@ -292,4 +292,4 @@ cases:
html5lib 0.999999999 because these package versions have
conflicting dependencies.
skip: old
skip: legacy

View file

@ -27,7 +27,7 @@ cases:
- fussy 3.8.0
- myapp 0.2.4
- requests 1.3.0
skip: old
skip: legacy
-
request:
- install: fussy

View file

@ -34,4 +34,4 @@ cases:
# - B 2.0.0
# - C 1.0.0
# but because B 2.0.0 depends on C >=2.0.0 this is wrong
skip: old
skip: legacy

View file

@ -21,4 +21,4 @@ cases:
- poetry 1.0.5
- sphinx 3.0.1
- zappa 0.51.0
skip: old
skip: legacy