Skip to content

Commit a8511da

Browse files
committed
Update YAML tests!
1 parent d76cd77 commit a8511da

13 files changed

+23
-23
lines changed

tests/functional/test_yaml.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def generate_yaml_tests(directory):
2727
base = data.get("base", {})
2828
cases = data["cases"]
2929

30-
for resolver in 'old', 'new':
30+
for resolver in 'legacy', '2020-resolver':
3131
for i, case_template in enumerate(cases):
3232
case = base.copy()
3333
case.update(case_template)
@@ -39,7 +39,7 @@ def generate_yaml_tests(directory):
3939
case[":resolver:"] = resolver
4040

4141
skip = case.pop("skip", False)
42-
assert skip in [False, True, 'old', 'new']
42+
assert skip in [False, True, 'legacy', '2020-resolver']
4343
if skip is True or skip == resolver:
4444
case = pytest.param(case, marks=pytest.mark.xfail)
4545

@@ -84,11 +84,11 @@ def stripping_split(my_str, splitwith, count=None):
8484
return retval
8585

8686

87-
def handle_request(script, action, requirement, options, new_resolver=False):
87+
def handle_request(script, action, requirement, options, resolver_variant):
8888
if action == 'install':
8989
args = ['install']
90-
if new_resolver:
91-
args.append("--use-feature=2020-resolver")
90+
if resolver_variant == "legacy":
91+
args.append("--use-deprecated=legacy-resolver")
9292
args.extend(["--no-index", "--find-links",
9393
path_to_url(script.scratch_path)])
9494
elif action == 'uninstall':
@@ -183,7 +183,7 @@ def test_yaml_based(script, case):
183183
effect = handle_request(script, action,
184184
request[action],
185185
request.get('options', '').split(),
186-
case[':resolver:'] == 'new')
186+
resolver_variant=case[':resolver:'])
187187
result = effect['result']
188188

189189
if 0: # for analyzing output easier

tests/yaml/backtrack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ cases:
3737
- A 1.0.0
3838
- B 1.0.0
3939
- C 1.0.0
40-
skip: old
40+
skip: legacy

tests/yaml/conflict_1.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cases:
1212
- error:
1313
code: 0
1414
stderr: ['incompatible']
15-
skip: old
15+
skip: legacy
1616
# -- a good error message would be:
1717
# A 1.0.0 has incompatible requirements B==1.0.0, B==2.0.0
1818

@@ -22,7 +22,7 @@ cases:
2222
response:
2323
- state:
2424
- B 1.0.0
25-
skip: old
25+
skip: legacy
2626
# -- old error:
2727
# Double requirement given: B (already in B==1.0.0, name='B')
2828

@@ -36,7 +36,7 @@ cases:
3636
stderr: >-
3737
Cannot install B==1.0.0 and B==2.0.0 because these
3838
package versions have conflicting dependencies.
39-
skip: old
39+
skip: legacy
4040
# -- currently the (new resolver) error message is:
4141
# Could not find a version that satisfies the requirement B==1.0.0
4242
# Could not find a version that satisfies the requirement B==2.0.0
@@ -55,7 +55,7 @@ cases:
5555
error:
5656
code: 1
5757
stderr: 'no\s+matching\s+distribution'
58-
skip: old
58+
skip: legacy
5959
# -- currently (new resolver) error message is:
6060
# Could not find a version that satisfies the requirement B==1.5.0
6161
# No matching distribution found for b
@@ -71,7 +71,7 @@ cases:
7171
error:
7272
code: 1
7373
stderr: 'no\s+matching\s+distribution'
74-
skip: old
74+
skip: legacy
7575
# -- currently the error message is:
7676
# Could not find a version that satisfies the requirement A==2.0
7777
# No matching distribution found for a

tests/yaml/conflict_2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ cases:
2525
stderr: >-
2626
Cannot install six<1.12 and virtualenv 20.0.2 because these
2727
package versions have conflicting dependencies.
28-
skip: old
28+
skip: legacy

tests/yaml/conflict_3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cases:
1111
- install: A
1212
response:
1313
- state: null
14-
skip: old
14+
skip: legacy
1515
# -- currently the error message is:
1616
# Could not find a version that satisfies the requirement C==2.0.0 (from a)
1717
# Could not find a version that satisfies the requirement C==1.0.0 (from b)

tests/yaml/conflicting_diamond.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ cases:
1616
versions have conflicting dependencies.
1717
# TODO: Tweak this error message to make sense.
1818
# https://github.com/pypa/pip/issues/8495
19-
skip: old
19+
skip: legacy

tests/yaml/conflicting_triangle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ cases:
1515
- error:
1616
code: 0
1717
stderr: ['c==1\.0\.0', 'incompatible']
18-
skip: old
18+
skip: legacy

tests/yaml/extras.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cases:
3939
- D 1.0.0
4040
- E 1.0.0
4141
- F 1.0.0
42-
skip: old
42+
skip: legacy
4343
-
4444
request:
4545
- install: D[extra_1]

tests/yaml/fallback.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ cases:
1717
# the old resolver tries to install A 1.0.0 (which fails), but the new
1818
# resolver realises that A 1.0.0 cannot be installed and falls back to
1919
# installing the older version A 0.8.0 instead.
20-
skip: old
20+
skip: legacy

tests/yaml/large.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ cases:
251251
- idna 2.7
252252
- pycparser 2.18
253253
- six 1.11.0
254-
skip: old
254+
skip: legacy
255255
-
256256
request:
257257
- install: cachecontrol
@@ -292,4 +292,4 @@ cases:
292292
html5lib 0.999999999 because these package versions have
293293
conflicting dependencies.
294294
295-
skip: old
295+
skip: legacy

tests/yaml/overlap1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cases:
2727
- fussy 3.8.0
2828
- myapp 0.2.4
2929
- requests 1.3.0
30-
skip: old
30+
skip: legacy
3131
-
3232
request:
3333
- install: fussy

tests/yaml/pip988.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ cases:
3434
# - B 2.0.0
3535
# - C 1.0.0
3636
# but because B 2.0.0 depends on C >=2.0.0 this is wrong
37-
skip: old
37+
skip: legacy

tests/yaml/poetry2298.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ cases:
2121
- poetry 1.0.5
2222
- sphinx 3.0.1
2323
- zappa 0.51.0
24-
skip: old
24+
skip: legacy

0 commit comments

Comments
 (0)