Skip to content

Commit bc690c4

Browse files
miss-islingtonaiskStanFromIreland
authored
[3.13] Re-raise unexpected exceptions instead of swallowing them in various tests (GH-152019) (#152104)
(cherry picked from commit 6c3da17) Co-authored-by: An Long <aisk@users.noreply.github.com> Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 58476e8 commit bc690c4

4 files changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/test/test_fcntl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ def test_fcntl_64_bit(self):
151151
except OSError as exc:
152152
if exc.errno == errno.EINVAL:
153153
self.skipTest("F_NOTIFY not available by this environment")
154+
raise
154155
fcntl.fcntl(fd, cmd, flags)
155156
finally:
156157
os.close(fd)

Lib/test/test_launcher.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ def test_search_major_2(self):
469469
except subprocess.CalledProcessError:
470470
if not is_installed("2.7"):
471471
raise unittest.SkipTest("requires at least one Python 2.x install")
472+
raise
472473
self.assertEqual("PythonCore", data["env.company"])
473474
self.assertTrue(data["env.tag"].startswith("2."), data["env.tag"])
474475

Lib/test/test_pathlib/test_pathlib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,7 @@ def test_is_socket_true(self):
11091109
if (isinstance(e, PermissionError) or
11101110
"AF_UNIX path too long" in str(e)):
11111111
self.skipTest("cannot bind Unix socket: " + str(e))
1112+
raise
11121113
self.assertTrue(P.is_socket())
11131114
self.assertFalse(P.is_fifo())
11141115
self.assertFalse(P.is_file())

Lib/test/test_socket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,7 @@ def testIPv6toString(self):
14091409
except OSError as e:
14101410
if e.winerror == 10022:
14111411
self.skipTest('IPv6 might not be supported')
1412+
raise
14121413

14131414
f = lambda a: inet_pton(AF_INET6, a)
14141415
assertInvalid = lambda a: self.assertRaises(
@@ -1499,6 +1500,7 @@ def testStringToIPv6(self):
14991500
except OSError as e:
15001501
if e.winerror == 10022:
15011502
self.skipTest('IPv6 might not be supported')
1503+
raise
15021504

15031505
f = lambda a: inet_ntop(AF_INET6, a)
15041506
assertInvalid = lambda a: self.assertRaises(

0 commit comments

Comments
 (0)