Skip to content

Commit e625695

Browse files
committed
Fix decreased coverage
1 parent def0dd5 commit e625695

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/test_cli_compile.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,3 +2925,15 @@ def test_compile_recursive_extras(runner, tmp_path, current_resolver):
29252925
"""
29262926
assert out.exit_code == 0
29272927
assert expected == out.stderr
2928+
2929+
2930+
def test_config_option(pip_conf, runner, tmp_path, make_config_file):
2931+
config_file = make_config_file("dry-run", True)
2932+
2933+
req_in = tmp_path / "requirements.in"
2934+
req_in.touch()
2935+
2936+
out = runner.invoke(cli, [req_in.as_posix(), "--config", config_file.as_posix()])
2937+
2938+
assert out.exit_code == 0
2939+
assert "Dry-run, so nothing updated" in out.stderr

tests/test_cli_sync.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,3 +372,16 @@ def test_default_python_executable_option(run, runner):
372372
"-r",
373373
]
374374
]
375+
376+
377+
@mock.patch("piptools.sync.run")
378+
def test_config_option(run, runner, make_config_file):
379+
config_file = make_config_file("dry-run", True)
380+
381+
with open(sync.DEFAULT_REQUIREMENTS_FILE, "w") as reqs_txt:
382+
reqs_txt.write("six==1.10.0")
383+
384+
out = runner.invoke(cli, ["--config", config_file.as_posix()])
385+
386+
assert out.exit_code == 1
387+
assert "Would install:" in out.stdout

0 commit comments

Comments
 (0)