Skip to content

Commit

Permalink
Change log level of hash message (#1460)
Browse files Browse the repository at this point in the history
  • Loading branch information
plannigan committed Aug 2, 2021
1 parent b46a2e7 commit 14afbf8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
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

0 comments on commit 14afbf8

Please sign in to comment.