diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py index 40449bcb0f0..2300403daf9 100644 --- a/src/pip/_internal/commands/install.py +++ b/src/pip/_internal/commands/install.py @@ -442,7 +442,8 @@ def run(self, options: Values, args: List[str]) -> int: # Check for conflicts in the package set we're installing. conflicts: Optional[ConflictDetails] = None should_warn_about_conflicts = ( - not options.ignore_dependencies and options.warn_about_conflicts + not (options.ignore_dependencies or options.ignore_dependencies_for) + and options.warn_about_conflicts ) if should_warn_about_conflicts: conflicts = self._determine_conflicts(to_install) diff --git a/tests/functional/test_new_resolver.py b/tests/functional/test_new_resolver.py index 3001a21847e..f15cbce2656 100644 --- a/tests/functional/test_new_resolver.py +++ b/tests/functional/test_new_resolver.py @@ -240,7 +240,7 @@ def test_new_resolver_ignore_dependencies_for(script: PipTestEnvironment) -> Non "dep2", "0.1.0", ) - result = script.pip( + script.pip( "install", "--no-cache-dir", "--no-index", @@ -253,7 +253,6 @@ def test_new_resolver_ignore_dependencies_for(script: PipTestEnvironment) -> Non ) script.assert_installed(base="0.1.0", base2="0.1.0", dep2="0.1.0") script.assert_not_installed("dep") - assert "base 0.1.0 requires dep, which is not installed." in result.stderr @pytest.mark.parametrize(