Skip to content

Commit

Permalink
Parametrize combined --upgrade and -P test
Browse files Browse the repository at this point in the history
... to cover when the -P pkgs are only subdependencies
  • Loading branch information
AndydeCleyre committed Oct 3, 2022
1 parent 051c72c commit 91a1c0e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_cli_compile.py
Expand Up @@ -803,13 +803,20 @@ def test_upgrade_packages_version_option_no_existing_file(pip_conf, runner):
assert "small-fake-b==0.2" in out.stderr


def test_upgrade_packages_version_option_and_upgrade(pip_conf, runner):
@pytest.mark.parametrize(
"reqs_in",
(
pytest.param("small-fake-a\nsmall-fake-b", id="direct reqs"),
pytest.param("small-fake-with-unpinned-deps", id="parent req"),
),
)
def test_upgrade_packages_version_option_and_upgrade(pip_conf, runner, reqs_in):
"""
piptools respects --upgrade-package/-P inline list with specified versions
whilst also doing --upgrade.
"""
with open("requirements.in", "w") as req_in:
req_in.write("small-fake-a\nsmall-fake-b")
req_in.write(reqs_in)
with open("requirements.txt", "w") as req_in:
req_in.write("small-fake-a==0.1\nsmall-fake-b==0.1")

Expand Down

0 comments on commit 91a1c0e

Please sign in to comment.