Skip to content

Commit 5494275

Browse files
committed
Test that the resolver skips packages, as instructed by constraints
1 parent 2905226 commit 5494275

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/functional/test_new_resolver.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2327,3 +2327,26 @@ def test_new_resolver_do_not_backtrack_on_build_failure(
23272327
)
23282328

23292329
assert "egg_info" in result.stderr
2330+
2331+
2332+
def test_new_resolver_works_when_failing_package_builds_are_disallowed(
2333+
script: PipTestEnvironment,
2334+
) -> None:
2335+
create_basic_wheel_for_package(script, "pkg2", "1.0", depends=["pkg1"])
2336+
create_basic_sdist_for_package(script, "pkg1", "2.0", fails_egg_info=True)
2337+
create_basic_wheel_for_package(script, "pkg1", "1.0")
2338+
constraints_file = script.scratch_path / "constraints.txt"
2339+
constraints_file.write_text("pkg1 != 2.0")
2340+
2341+
script.pip(
2342+
"install",
2343+
"--no-cache-dir",
2344+
"--no-index",
2345+
"--find-links",
2346+
script.scratch_path,
2347+
"-c",
2348+
constraints_file,
2349+
"pkg2",
2350+
)
2351+
2352+
script.assert_installed(pkg2="1.0", pkg1="1.0")

0 commit comments

Comments
 (0)