Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test that the resolver skips packages, as instructed by constraints
Browse files Browse the repository at this point in the history
pradyunsg committed Dec 12, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 2905226 commit 5494275
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/functional/test_new_resolver.py
Original file line number Diff line number Diff line change
@@ -2327,3 +2327,26 @@ def test_new_resolver_do_not_backtrack_on_build_failure(
)

assert "egg_info" in result.stderr


def test_new_resolver_works_when_failing_package_builds_are_disallowed(
script: PipTestEnvironment,
) -> None:
create_basic_wheel_for_package(script, "pkg2", "1.0", depends=["pkg1"])
create_basic_sdist_for_package(script, "pkg1", "2.0", fails_egg_info=True)
create_basic_wheel_for_package(script, "pkg1", "1.0")
constraints_file = script.scratch_path / "constraints.txt"
constraints_file.write_text("pkg1 != 2.0")

script.pip(
"install",
"--no-cache-dir",
"--no-index",
"--find-links",
script.scratch_path,
"-c",
constraints_file,
"pkg2",
)

script.assert_installed(pkg2="1.0", pkg1="1.0")

0 comments on commit 5494275

Please sign in to comment.