From ad9b0416502b334ade73e2ce21db85d586ebfcc5 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Thu, 30 Sep 2021 00:50:38 +0800 Subject: [PATCH 1/5] Don't skip extra-merging test on 2020 resolver --- tests/functional/test_install_extras.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tests/functional/test_install_extras.py b/tests/functional/test_install_extras.py index 18e9f6e8129..b950e5bae02 100644 --- a/tests/functional/test_install_extras.py +++ b/tests/functional/test_install_extras.py @@ -172,15 +172,22 @@ def test_install_requirements_no_r_flag(script): @pytest.mark.parametrize( - "extra_to_install, simple_version", + "extra_to_install, simple_version, fails_on_legacy", [ - ["", "3.0"], - pytest.param("[extra1]", "2.0", marks=pytest.mark.xfail), - pytest.param("[extra2]", "1.0", marks=pytest.mark.xfail), - pytest.param("[extra1,extra2]", "1.0", marks=pytest.mark.xfail), + ("", "3.0", False), + ("[extra1]", "2.0", True), + ("[extra2]", "1.0", True), + ("[extra1,extra2]", "1.0", True), ], ) -def test_install_extra_merging(script, data, extra_to_install, simple_version): +@pytest.mark.usefixtures("data") +def test_install_extra_merging( + script, + resolver_variant, + extra_to_install, + simple_version, + fails_on_legacy, +): # Check that extra specifications in the extras section are honoured. pkga_path = script.scratch_path / "pkga" pkga_path.mkdir() @@ -200,6 +207,9 @@ def test_install_extra_merging(script, data, extra_to_install, simple_version): result = script.pip_install_local( f"{pkga_path}{extra_to_install}", + expect_error=(fails_on_legacy and resolver_variant == "legacy"), ) - assert f"Successfully installed pkga-0.1 simple-{simple_version}" in result.stdout + if not fails_on_legacy or resolver_variant == "2020-resolver": + expected = f"Successfully installed pkga-0.1 simple-{simple_version}" + assert expected in result.stdout From 5aace2a5d21e2d4760c22762ff16ffeeb916c921 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Thu, 30 Sep 2021 15:20:13 +0800 Subject: [PATCH 2/5] Har-fail on unexpected xfail pass --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 6a3e8c7f5da..0f790570583 100644 --- a/setup.cfg +++ b/setup.cfg @@ -61,6 +61,7 @@ allow_untyped_defs = True [tool:pytest] addopts = --ignore src/pip/_vendor --ignore tests/tests_cache -r aR --color=yes +xfail_strict = True markers = network: tests that need network incompatible_with_sysconfig From 8043eb267e94d76be547945021d0cfb0353c602d Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Thu, 30 Sep 2021 15:30:42 +0800 Subject: [PATCH 3/5] Remove stale xfail on macOS tag generation --- tests/unit/test_models_wheel.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/unit/test_models_wheel.py b/tests/unit/test_models_wheel.py index 4ada81f70be..c06525e089e 100644 --- a/tests/unit/test_models_wheel.py +++ b/tests/unit/test_models_wheel.py @@ -92,14 +92,6 @@ def test_not_supported_osx_version(self) -> None: w = Wheel("simple-0.1-cp27-none-macosx_10_9_intel.whl") assert not w.supported(tags=tags) - @pytest.mark.xfail( - reason=( - "packaging.tags changed behaviour in this area, and @pradyunsg " - "decided as the release manager that this behaviour change is less " - "critical than Big Sur support for pip 20.3. See " - "https://github.com/pypa/packaging/pull/361 for further discussion." - ) - ) def test_supported_multiarch_darwin(self) -> None: """ Multi-arch wheels (intel) are supported on components (i386, x86_64) From fbdc4648c222dd03535e496bfee4c3a47588cfca Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Thu, 30 Sep 2021 15:55:57 +0800 Subject: [PATCH 4/5] Remove --build xfail for now The option is current restored. We should remove this test after the option is removed (again). --- tests/functional/test_wheel.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/functional/test_wheel.py b/tests/functional/test_wheel.py index 7b3932af067..17d94e85314 100644 --- a/tests/functional/test_wheel.py +++ b/tests/functional/test_wheel.py @@ -240,7 +240,6 @@ def test_pip_wheel_fail(script, data): assert result.returncode != 0 -@pytest.mark.xfail(reason="The --build option was removed") def test_no_clean_option_blocks_cleaning_after_wheel( script, data, From 12cb74598598dce9edcc9a0eb99dd79d85700105 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Thu, 30 Sep 2021 15:59:36 +0800 Subject: [PATCH 5/5] Remove xfail from a weird but passing test --- tests/functional/test_install_reqs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/test_install_reqs.py b/tests/functional/test_install_reqs.py index 049cd7ab545..520ad01897b 100644 --- a/tests/functional/test_install_reqs.py +++ b/tests/functional/test_install_reqs.py @@ -213,7 +213,7 @@ def test_multiple_constraints_files(script, data): assert "installed Upper-1.0" in result.stdout -@pytest.mark.xfail(reason="Unclear what this guarantee is for.") +# FIXME: Unclear what this guarantee is for. def test_respect_order_in_requirements_file(script, data): script.scratch_path.joinpath("frameworks-req.txt").write_text( textwrap.dedent(