mirror of
https://github.com/python/cpython.git
synced 2026-06-29 04:10:54 +00:00
[3.13] Re-raise unexpected exceptions instead of swallowing them in various tests (GH-152019) (#152104)
(cherry picked from commit 6c3da17d1f)
Co-authored-by: An Long <aisk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
This commit is contained in:
parent
58476e8cbb
commit
bc690c4b5f
4 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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.assertTrue(data["env.tag"].startswith("2."), data["env.tag"])
|
||||
|
||||
|
|
|
|||
|
|
@ -1109,6 +1109,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())
|
||||
|
|
|
|||
|
|
@ -1409,6 +1409,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(
|
||||
|
|
@ -1499,6 +1500,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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue