Skip to content

Commit

Permalink
Test that the resolver skips packages, as instructed by constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Jan 27, 2022
1 parent 8eeee22 commit ca78aba
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
Expand Up @@ -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 ca78aba

Please sign in to comment.