Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change log level of hash message #1460

Merged
merged 3 commits into from Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion piptools/repositories/pypi.py
Expand Up @@ -331,7 +331,7 @@ def get_hashes(self, ireq: InstallRequirement) -> Set[str]:
with log.indentation():
hashes = self._get_hashes_from_pypi(ireq)
if hashes is None:
log.log("Couldn't get hashes from PyPI, fallback to hashing files")
log.debug("Couldn't get hashes from PyPI, fallback to hashing files")
return self._get_hashes_from_files(ireq)

return hashes
Expand Down
13 changes: 2 additions & 11 deletions tests/test_repository_local.py
Expand Up @@ -19,10 +19,7 @@ def test_get_hashes_local_repository_cache_miss(
assert hashes == EXPECTED
captured = capsys.readouterr()
assert captured.out == ""
assert (
captured.err.strip()
== "Couldn't get hashes from PyPI, fallback to hashing files"
)
assert captured.err == ""


def test_get_hashes_local_repository_cache_hit(from_line, repository):
Expand Down Expand Up @@ -59,13 +56,7 @@ def test_toggle_reuse_hashes_local_repository(
assert local_repository.get_hashes(from_line("small-fake-a==0.1")) == expected
captured = capsys.readouterr()
assert captured.out == ""
if reuse_hashes:
assert captured.err == ""
else:
assert (
captured.err.strip()
== "Couldn't get hashes from PyPI, fallback to hashing files"
)
assert captured.err == ""


class FakeRepositoryChecksForCopy(FakeRepository):
Expand Down
5 changes: 1 addition & 4 deletions tests/test_repository_pypi.py
Expand Up @@ -22,10 +22,7 @@ def test_generate_hashes_all_platforms(capsys, pip_conf, from_line, pypi_reposit
assert pypi_repository.get_hashes(ireq) == expected
captured = capsys.readouterr()
assert captured.out == ""
assert (
captured.err.strip()
== "Couldn't get hashes from PyPI, fallback to hashing files"
)
assert captured.err == ""


@pytest.mark.network
Expand Down