diff --git a/piptools/repositories/pypi.py b/piptools/repositories/pypi.py index 8198bd115..a6f147a0a 100644 --- a/piptools/repositories/pypi.py +++ b/piptools/repositories/pypi.py @@ -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 diff --git a/tests/test_repository_local.py b/tests/test_repository_local.py index b95d3b5b8..9381770a2 100644 --- a/tests/test_repository_local.py +++ b/tests/test_repository_local.py @@ -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): @@ -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): diff --git a/tests/test_repository_pypi.py b/tests/test_repository_pypi.py index 3238abf48..078a181e9 100644 --- a/tests/test_repository_pypi.py +++ b/tests/test_repository_pypi.py @@ -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