From ec9bb109228aa3d8ad2952d72d1374b43157be53 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 30 Oct 2020 06:57:15 +0530 Subject: [PATCH] Update YAML tests for resolver changes --- tests/functional/test_yaml.py | 12 ++++++------ tests/yaml/backtrack.yml | 2 +- tests/yaml/conflict_1.yml | 10 +++++----- tests/yaml/conflict_2.yml | 2 +- tests/yaml/conflict_3.yml | 2 +- tests/yaml/conflicting_diamond.yml | 2 +- tests/yaml/conflicting_triangle.yml | 2 +- tests/yaml/extras.yml | 2 +- tests/yaml/fallback.yml | 2 +- tests/yaml/large.yml | 4 ++-- tests/yaml/overlap1.yml | 2 +- tests/yaml/pip988.yml | 2 +- tests/yaml/poetry2298.yml | 2 +- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/functional/test_yaml.py b/tests/functional/test_yaml.py index e22a01ace..4b5f38f97 100644 --- a/tests/functional/test_yaml.py +++ b/tests/functional/test_yaml.py @@ -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 diff --git a/tests/yaml/backtrack.yml b/tests/yaml/backtrack.yml index 0fe843875..ffcb722b8 100644 --- a/tests/yaml/backtrack.yml +++ b/tests/yaml/backtrack.yml @@ -37,4 +37,4 @@ cases: - A 1.0.0 - B 1.0.0 - C 1.0.0 - skip: old + skip: legacy diff --git a/tests/yaml/conflict_1.yml b/tests/yaml/conflict_1.yml index c0a561995..dc18be32a 100644 --- a/tests/yaml/conflict_1.yml +++ b/tests/yaml/conflict_1.yml @@ -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 diff --git a/tests/yaml/conflict_2.yml b/tests/yaml/conflict_2.yml index 8a51ad57f..7ec5848ed 100644 --- a/tests/yaml/conflict_2.yml +++ b/tests/yaml/conflict_2.yml @@ -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 diff --git a/tests/yaml/conflict_3.yml b/tests/yaml/conflict_3.yml index d261b3158..53f2b4a98 100644 --- a/tests/yaml/conflict_3.yml +++ b/tests/yaml/conflict_3.yml @@ -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) diff --git a/tests/yaml/conflicting_diamond.yml b/tests/yaml/conflicting_diamond.yml index 0ea5f9ca8..c28b667ac 100644 --- a/tests/yaml/conflicting_diamond.yml +++ b/tests/yaml/conflicting_diamond.yml @@ -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 diff --git a/tests/yaml/conflicting_triangle.yml b/tests/yaml/conflicting_triangle.yml index e8e88b347..02b348ca2 100644 --- a/tests/yaml/conflicting_triangle.yml +++ b/tests/yaml/conflicting_triangle.yml @@ -15,4 +15,4 @@ cases: - error: code: 0 stderr: ['c==1\.0\.0', 'incompatible'] - skip: old + skip: legacy diff --git a/tests/yaml/extras.yml b/tests/yaml/extras.yml index ac68fae49..b0f4e992c 100644 --- a/tests/yaml/extras.yml +++ b/tests/yaml/extras.yml @@ -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] diff --git a/tests/yaml/fallback.yml b/tests/yaml/fallback.yml index 6902ad579..86925398a 100644 --- a/tests/yaml/fallback.yml +++ b/tests/yaml/fallback.yml @@ -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 diff --git a/tests/yaml/large.yml b/tests/yaml/large.yml index 0d5f6f3ef..fbb1c737e 100644 --- a/tests/yaml/large.yml +++ b/tests/yaml/large.yml @@ -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 diff --git a/tests/yaml/overlap1.yml b/tests/yaml/overlap1.yml index 9cad2650b..9afbb04c3 100644 --- a/tests/yaml/overlap1.yml +++ b/tests/yaml/overlap1.yml @@ -27,7 +27,7 @@ cases: - fussy 3.8.0 - myapp 0.2.4 - requests 1.3.0 - skip: old + skip: legacy - request: - install: fussy diff --git a/tests/yaml/pip988.yml b/tests/yaml/pip988.yml index 29441f3a0..1190d2a4e 100644 --- a/tests/yaml/pip988.yml +++ b/tests/yaml/pip988.yml @@ -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 diff --git a/tests/yaml/poetry2298.yml b/tests/yaml/poetry2298.yml index 992f3a02e..8b0670896 100644 --- a/tests/yaml/poetry2298.yml +++ b/tests/yaml/poetry2298.yml @@ -21,4 +21,4 @@ cases: - poetry 1.0.5 - sphinx 3.0.1 - zappa 0.51.0 - skip: old + skip: legacy