Skip to content

Commit

Permalink
Add test: "ignore incompatible existing pins"
Browse files Browse the repository at this point in the history
It shouldn't raise an error when a preexisting output file's
pins conflict with the input files' constraints.

jazzband/pip-tools#1539 (comment)
  • Loading branch information
JiachenSmith authored and atugushev committed Nov 25, 2023
1 parent ebd4a4f commit b7cbc89
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_cli_compile.py
Expand Up @@ -702,6 +702,20 @@ def test_input_file_without_extension(pip_conf, runner):
assert os.path.exists("requirements.txt")


def test_ignore_incompatible_existing_pins(pip_conf, runner):
"""
Successfully compile when existing output pins conflict with input.
"""
with open("requirements.in", "w") as req_in:
req_in.write("small-fake-b>0.1")
with open("requirements.txt", "w") as req_in:
req_in.write("small-fake-b==0.1")

out = runner.invoke(cli, [])

assert out.exit_code == 0


def test_upgrade_packages_option(pip_conf, runner):
"""
piptools respects --upgrade-package/-P inline list.
Expand Down

0 comments on commit b7cbc89

Please sign in to comment.