diff --git a/piptools/scripts/compile.py b/piptools/scripts/compile.py index b2fb4a9c4..b1dcbf388 100755 --- a/piptools/scripts/compile.py +++ b/piptools/scripts/compile.py @@ -415,4 +415,4 @@ def cli( ) if dry_run: - log.warning("Dry-run, so nothing updated.") + log.info("Dry-run, so nothing updated.") diff --git a/tests/test_cli_compile.py b/tests/test_cli_compile.py index 6727d8210..cb20ae953 100644 --- a/tests/test_cli_compile.py +++ b/tests/test_cli_compile.py @@ -455,8 +455,24 @@ def test_quiet_option(runner): with open("requirements", "w"): pass out = runner.invoke(cli, ["--quiet", "-n", "requirements"]) - # Pinned requirements result has not been written to output - assert "Dry-run, so nothing updated." == out.stderr.strip() + # Pinned requirements result has not been written to output. + assert not out.stderr_bytes + + +def test_dry_run_noisy_option(runner): + with open("requirements", "w"): + pass + out = runner.invoke(cli, ["--dry-run", "requirements"]) + # Dry-run message has been written to output + assert "Dry-run, so nothing updated." in out.stderr.splitlines() + + +def test_dry_run_quiet_option(runner): + with open("requirements", "w"): + pass + out = runner.invoke(cli, ["--dry-run", "--quiet", "requirements"]) + # Dry-run message has not been written to output. + assert not out.stderr_bytes def test_generate_hashes_with_editable(runner):