bpo-23819: Fix asyncio tests on python optimized mode (GH-30195)

This commit is contained in:
Kumar Aditya 2021-12-26 16:43:14 +05:30 committed by GitHub
parent f9a4352056
commit a23ab7b6d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 4 deletions

View file

@ -77,6 +77,7 @@ class ProactorSocketTransportTests(test_utils.TestCase):
self.loop._proactor.recv_into.assert_called_with(self.sock, called_buf)
self.protocol.data_received.assert_called_with(bytearray(buf))
@unittest.skipIf(sys.flags.optimize, "Assertions are disabled in optimized mode")
def test_loop_reading_no_data(self):
res = self.loop.create_future()
res.set_result(0)
@ -869,6 +870,7 @@ class BaseProactorEventLoopTests(test_utils.TestCase):
self.protocol.datagram_received.assert_called_with(b'data', ('127.0.0.1', 12068))
close_transport(tr)
@unittest.skipIf(sys.flags.optimize, "Assertions are disabled in optimized mode")
def test_datagram_loop_reading_no_data(self):
res = self.loop.create_future()
res.set_result((b'', ('127.0.0.1', 12068)))