mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-34622: Extract asyncio exceptions into a separate module (GH-9141)
This commit is contained in:
parent
7c7605ff11
commit
0baa72f4b2
18 changed files with 148 additions and 110 deletions
|
@ -951,7 +951,7 @@ class ProactorEventLoopUnixSockSendfileTests(test_utils.TestCase):
|
|||
def test_sock_sendfile_not_a_file(self):
|
||||
sock, proto = self.prepare()
|
||||
f = object()
|
||||
with self.assertRaisesRegex(events.SendfileNotAvailableError,
|
||||
with self.assertRaisesRegex(asyncio.SendfileNotAvailableError,
|
||||
"not a regular file"):
|
||||
self.run_loop(self.loop._sock_sendfile_native(sock, f,
|
||||
0, None))
|
||||
|
@ -960,7 +960,7 @@ class ProactorEventLoopUnixSockSendfileTests(test_utils.TestCase):
|
|||
def test_sock_sendfile_iobuffer(self):
|
||||
sock, proto = self.prepare()
|
||||
f = io.BytesIO()
|
||||
with self.assertRaisesRegex(events.SendfileNotAvailableError,
|
||||
with self.assertRaisesRegex(asyncio.SendfileNotAvailableError,
|
||||
"not a regular file"):
|
||||
self.run_loop(self.loop._sock_sendfile_native(sock, f,
|
||||
0, None))
|
||||
|
@ -970,7 +970,7 @@ class ProactorEventLoopUnixSockSendfileTests(test_utils.TestCase):
|
|||
sock, proto = self.prepare()
|
||||
f = mock.Mock()
|
||||
f.fileno.return_value = -1
|
||||
with self.assertRaisesRegex(events.SendfileNotAvailableError,
|
||||
with self.assertRaisesRegex(asyncio.SendfileNotAvailableError,
|
||||
"not a regular file"):
|
||||
self.run_loop(self.loop._sock_sendfile_native(sock, f,
|
||||
0, None))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue