From f2e4e61f4b916585dc77a36f895b0e2db10fc422 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 8 Aug 2024 11:20:58 +0200 Subject: [PATCH] gh-122744: test_venv: ignore pip's complaint about missing ssl (GH-122776) (cherry picked from commit 0d9c123d1ac4f3dd30bdef5182049d9a831eca10) Co-authored-by: Petr Viktorin --- Lib/test/test_venv.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index feaf9784549068..83d03aa3bf0d9c 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -782,6 +782,14 @@ def do_test_with_pip(self, system_site_packages): err = re.sub("^(WARNING: )?The directory .* or its parent directory " "is not owned or is not writable by the current user.*$", "", err, flags=re.MULTILINE) + # Ignore warning about missing optional module: + try: + import ssl + except ImportError: + err = re.sub( + "^WARNING: Disabling truststore since ssl support is missing$", + "", + err, flags=re.MULTILINE) self.assertEqual(err.rstrip(), "") # Being fairly specific regarding the expected behaviour for the # initial bundling phase in Python 3.4. If the output changes in