Skip to content

Commit

Permalink
Fix decreased coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
atugushev committed Jul 1, 2023
1 parent def0dd5 commit e625695
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_cli_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2925,3 +2925,15 @@ def test_compile_recursive_extras(runner, tmp_path, current_resolver):
"""
assert out.exit_code == 0
assert expected == out.stderr


def test_config_option(pip_conf, runner, tmp_path, make_config_file):
config_file = make_config_file("dry-run", True)

req_in = tmp_path / "requirements.in"
req_in.touch()

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

assert out.exit_code == 0
assert "Dry-run, so nothing updated" in out.stderr
13 changes: 13 additions & 0 deletions tests/test_cli_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,16 @@ def test_default_python_executable_option(run, runner):
"-r",
]
]


@mock.patch("piptools.sync.run")
def test_config_option(run, runner, make_config_file):
config_file = make_config_file("dry-run", True)

with open(sync.DEFAULT_REQUIREMENTS_FILE, "w") as reqs_txt:
reqs_txt.write("six==1.10.0")

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

assert out.exit_code == 1
assert "Would install:" in out.stdout

0 comments on commit e625695

Please sign in to comment.