From 58d8dc28cb841317453b7ce62680d7cf15761866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Tue, 2 Aug 2022 12:19:13 +0200 Subject: [PATCH] Do not fail tests on our own deprecation warnings --- tests/lib/__init__.py | 3 +-- tests/lib/test_lib.py | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/lib/__init__.py b/tests/lib/__init__.py index c753768c9..1dfaea7e0 100644 --- a/tests/lib/__init__.py +++ b/tests/lib/__init__.py @@ -39,7 +39,6 @@ from pip._internal.models.search_scope import SearchScope from pip._internal.models.selection_prefs import SelectionPreferences from pip._internal.models.target_python import TargetPython from pip._internal.network.session import PipSession -from pip._internal.utils.deprecation import DEPRECATION_MSG_PREFIX from tests.lib.venv import VirtualEnvironment from tests.lib.wheel import make_wheel @@ -474,7 +473,7 @@ def _check_stderr( if allow_stderr_warning: continue - if line.startswith("WARNING: ") or line.startswith(DEPRECATION_MSG_PREFIX): + if line.startswith("WARNING: "): reason = ( "stderr has an unexpected warning " "(pass allow_stderr_warning=True to permit this)" diff --git a/tests/lib/test_lib.py b/tests/lib/test_lib.py index ea9baed54..a541a0a20 100644 --- a/tests/lib/test_lib.py +++ b/tests/lib/test_lib.py @@ -150,7 +150,6 @@ class TestPipTestEnvironment: @pytest.mark.parametrize( "prefix", ( - "DEPRECATION", "WARNING", "ERROR", ), @@ -167,7 +166,6 @@ class TestPipTestEnvironment: @pytest.mark.parametrize( "prefix, expected_start", ( - ("DEPRECATION", "stderr has an unexpected warning"), ("WARNING", "stderr has an unexpected warning"), ("ERROR", "stderr has an unexpected error"), ),