Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
csalerno-asml committed Jan 17, 2024
1 parent 7d1393d commit f6ba1c4
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/test_cli_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3447,47 +3447,48 @@ def test_allow_in_config_pip_sync_option(pip_conf, runner, tmp_path, make_config
assert "Using pip-tools configuration defaults found" in out.stderr


def test_use_src_files_from_config_if_option_is_not_specified_from_cli(pip_conf, runner, tmp_path, make_config_file):
def test_use_src_files_from_config_if_option_is_not_specified_from_cli(
pip_conf, runner, tmp_path, make_config_file
):
foo_in = tmp_path / "foo.in"
req_in = tmp_path / "requirements.in"

config_file = make_config_file("src-files", [foo_in.as_posix()])

with open(req_in, "w") as f:
f.write("small-fake-a==0.1")

with open(foo_in, "w") as f:
f.write("small-fake-b==0.1")

out = runner.invoke(
cli, ["--config", config_file.as_posix()]
)
out = runner.invoke(cli, ["--config", config_file.as_posix()])

assert out.exit_code == 0
assert "small-fake-b" in out.stderr
assert "small-fake-a" not in out.stderr


def test_use_src_files_from_cli_if_option_is_specified_in_both_config_and_cli(pip_conf, runner, tmp_path, make_config_file):
def test_use_src_files_from_cli_if_option_is_specified_in_both_config_and_cli(
pip_conf, runner, tmp_path, make_config_file
):
foo_in = tmp_path / "foo.in"
req_in = tmp_path / "requirements.in"

config_file = make_config_file("src-files", [foo_in.as_posix()])

with open(req_in, "w") as f:
f.write("small-fake-a==0.1")

with open(foo_in, "w") as f:
f.write("small-fake-b==0.1")

out = runner.invoke(
cli, [req_in.as_posix(), "--config", config_file.as_posix()]
)
out = runner.invoke(cli, [req_in.as_posix(), "--config", config_file.as_posix()])

assert out.exit_code == 0
assert "small-fake-a" in out.stderr
assert "small-fake-b" not in out.stderr


def test_cli_boolean_flag_config_option_has_valid_context(
pip_conf, runner, tmp_path, make_config_file
):
Expand Down

0 comments on commit f6ba1c4

Please sign in to comment.