Skip to content

Commit

Permalink
Merge pull request #1774 from AndydeCleyre/feature/test-ignore-compil…
Browse files Browse the repository at this point in the history
…ed-unavailable-version

Add test: ignore unavailable versions in preexisting output
  • Loading branch information
atugushev committed Dec 13, 2022
2 parents 6fc9b91 + 601b5c4 commit e085800
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/test_cli_compile.py
Expand Up @@ -23,6 +23,12 @@
indirect=("current_resolver",),
)

backtracking_resolver_only = pytest.mark.parametrize(
"current_resolver",
("backtracking",),
indirect=("current_resolver",),
)


@pytest.fixture(
autouse=True,
Expand Down Expand Up @@ -2030,6 +2036,28 @@ def test_preserve_compiled_prerelease_version(pip_conf, runner):
assert "small-fake-a==0.3b1" in out.stderr.splitlines()


@backtracking_resolver_only
def test_ignore_compiled_unavailable_version(pip_conf, runner, current_resolver):

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 e085800

Please sign in to comment.