Skip to content

Commit

Permalink
Add test: ignore unavailable versions in preexisting output
Browse files Browse the repository at this point in the history
Rather than fail and exit early,
it's better to discard these items.

The legacy resolver does not pass,
and there is no plan to fix that before
we drop that resolver completely.
  • Loading branch information
AndydeCleyre committed Dec 13, 2022
1 parent 6fc9b91 commit 599a8d2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_cli_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,31 @@ def test_preserve_compiled_prerelease_version(pip_conf, runner):
assert "small-fake-a==0.3b1" in out.stderr.splitlines()


def test_ignore_compiled_unavailable_version(pip_conf, runner, current_resolver):
if current_resolver == "legacy":
pytest.xfail(
"We know this is broken in the legacy resolver, but no fix is planned."
)

with open("requirements.in", "w") as req_in:
req_in.write("small-fake-a")

with open("requirements.txt", "w") as req_txt:
req_txt.write("small-fake-a==9999")

out = runner.invoke(cli, ["--no-annotate", "--no-header"])

assert out.exit_code == 0, out
assert "small-fake-a==" in out.stderr
assert "small-fake-a==9999" not in out.stderr.splitlines()

assert (
"Discarding small-fake-a==9999 "
"(from -r requirements.txt (line 1)) "
"to proceed the resolution"
) in out.stderr


def test_prefer_binary_dist(
pip_conf, make_package, make_sdist, make_wheel, tmpdir, runner
):
Expand Down

0 comments on commit 599a8d2

Please sign in to comment.