diff --git a/src/pip/_internal/resolution/resolvelib/reporter.py b/src/pip/_internal/resolution/resolvelib/reporter.py index b0da83c7e..1d0dd9798 100644 --- a/src/pip/_internal/resolution/resolvelib/reporter.py +++ b/src/pip/_internal/resolution/resolvelib/reporter.py @@ -21,6 +21,11 @@ class PipReporter(BaseReporter): self.backtracks_by_package = defaultdict(int) # type: DefaultDict[str, int] self._messages_at_backtrack = { + 1: ( + "pip is looking at multiple versions of this package to determine " + "which version is compatible with other requirements. " + "This could take a while." + ), 8: ( "pip is looking at multiple versions of this package to determine " "which version is compatible with other requirements. " diff --git a/tests/functional/test_new_resolver.py b/tests/functional/test_new_resolver.py index aa1744cc8..91befb7f5 100644 --- a/tests/functional/test_new_resolver.py +++ b/tests/functional/test_new_resolver.py @@ -1048,7 +1048,7 @@ def test_new_resolver_prefers_installed_in_upgrade_if_latest(script): assert_installed(script, pkg="2") -@pytest.mark.parametrize("N", [10, 20]) +@pytest.mark.parametrize("N", [2, 10, 20]) def test_new_resolver_presents_messages_when_backtracking_a_lot(script, N): # Generate a set of wheels that will definitely cause backtracking. for index in range(1, N+1): @@ -1087,7 +1087,10 @@ def test_new_resolver_presents_messages_when_backtracking_a_lot(script, N): ) assert_installed(script, A="1.0.0", B="1.0.0", C="1.0.0") - if N >= 8: # this number is hard-coded in the code too. + # These numbers are hard-coded in the code. + if N >= 1: assert "This could take a while." in result.stdout - if N >= 13: # this number is hard-coded in the code too. + if N >= 8: + assert result.stdout.count("This could take a while.") >= 2 + if N >= 13: assert "press Ctrl + C" in result.stdout