Skip to content

Commit

Permalink
Test for constraint in message
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Feb 22, 2021
1 parent 7c0428e commit 66c4cf3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/functional/test_new_resolver_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,24 @@ def test_new_resolver_conflict_requirements_file(tmpdir, script):

message = "package versions have conflicting dependencies"
assert message in result.stderr, str(result)


def test_new_resolver_conflict_constraints_file(tmpdir, script):
create_basic_wheel_for_package(script, "pkg", "1.0")

constrats_file = tmpdir.joinpath("constraints.txt")
constrats_file.write_text("pkg!=1.0")

result = script.pip(
"install",
"--no-cache-dir", "--no-index",
"--find-links", script.scratch_path,
"-c", constrats_file,
"pkg==1.0",
expect_error=True,
)

assert "ResolutionImpossible" in result.stderr, str(result)

message = "The user requested (constraint) pkg!=1.0",
assert message in result.stdout, str(result)

0 comments on commit 66c4cf3

Please sign in to comment.