https://github.com/python/cpython/commit/eb7b5a09f8ecd5693a5ae0203066694a12b1e72c
commit: eb7b5a09f8ecd5693a5ae0203066694a12b1e72c
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-06-24T16:55:45Z
summary:

[3.14] Re-raise unexpected exceptions instead of swallowing them in various 
tests (GH-152019) (#152103)

(cherry picked from commit 6c3da17d1f333f6bd4c07d11e2e304159d550822)

Co-authored-by: An Long <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>

files:
M Lib/test/test_fcntl.py
M Lib/test/test_launcher.py
M Lib/test/test_pathlib/test_pathlib.py
M Lib/test/test_socket.py

diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 9f1e2e250fe854..86c5ca4058e7d3 100644
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -151,6 +151,7 @@ def test_fcntl_64_bit(self):
             except OSError as exc:
                 if exc.errno == errno.EINVAL:
                     self.skipTest("F_NOTIFY not available by this environment")
+                raise
             fcntl.fcntl(fd, cmd, flags)
         finally:
             os.close(fd)
diff --git a/Lib/test/test_launcher.py b/Lib/test/test_launcher.py
index c522bc1c2c093c..795890bd7e4b47 100644
--- a/Lib/test/test_launcher.py
+++ b/Lib/test/test_launcher.py
@@ -469,6 +469,7 @@ def test_search_major_2(self):
         except subprocess.CalledProcessError:
             if not is_installed("2.7"):
                 raise unittest.SkipTest("requires at least one Python 2.x 
install")
+            raise
         self.assertEqual("PythonCore", data["env.company"])
         self.assertStartsWith(data["env.tag"], "2.")
 
diff --git a/Lib/test/test_pathlib/test_pathlib.py 
b/Lib/test/test_pathlib/test_pathlib.py
index a1ea69a6b906e8..a7fa9865b61324 100644
--- a/Lib/test/test_pathlib/test_pathlib.py
+++ b/Lib/test/test_pathlib/test_pathlib.py
@@ -2769,6 +2769,7 @@ def test_is_socket_true(self):
             if (isinstance(e, PermissionError) or
                     "AF_UNIX path too long" in str(e)):
                 self.skipTest("cannot bind Unix socket: " + str(e))
+            raise
         self.assertTrue(P.is_socket())
         self.assertFalse(P.is_fifo())
         self.assertFalse(P.is_file())
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index d25f0ac159afb8..9392c7501d5359 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1415,6 +1415,7 @@ def testIPv6toString(self):
             except OSError as e:
                 if e.winerror == 10022:
                     self.skipTest('IPv6 might not be supported')
+                raise
 
         f = lambda a: inet_pton(AF_INET6, a)
         assertInvalid = lambda a: self.assertRaises(
@@ -1505,6 +1506,7 @@ def testStringToIPv6(self):
             except OSError as e:
                 if e.winerror == 10022:
                     self.skipTest('IPv6 might not be supported')
+                raise
 
         f = lambda a: inet_ntop(AF_INET6, a)
         assertInvalid = lambda a: self.assertRaises(

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to