mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
bpo-32436: Implement PEP 567 (#5027)
This commit is contained in:
parent
9089a26591
commit
f23746a934
41 changed files with 6269 additions and 120 deletions
|
@ -192,14 +192,14 @@ class BaseEventLoopTests(test_utils.TestCase):
|
|||
self.assertRaises(RuntimeError, self.loop.run_until_complete, f)
|
||||
|
||||
def test__add_callback_handle(self):
|
||||
h = asyncio.Handle(lambda: False, (), self.loop)
|
||||
h = asyncio.Handle(lambda: False, (), self.loop, None)
|
||||
|
||||
self.loop._add_callback(h)
|
||||
self.assertFalse(self.loop._scheduled)
|
||||
self.assertIn(h, self.loop._ready)
|
||||
|
||||
def test__add_callback_cancelled_handle(self):
|
||||
h = asyncio.Handle(lambda: False, (), self.loop)
|
||||
h = asyncio.Handle(lambda: False, (), self.loop, None)
|
||||
h.cancel()
|
||||
|
||||
self.loop._add_callback(h)
|
||||
|
@ -333,9 +333,9 @@ class BaseEventLoopTests(test_utils.TestCase):
|
|||
|
||||
def test__run_once(self):
|
||||
h1 = asyncio.TimerHandle(time.monotonic() + 5.0, lambda: True, (),
|
||||
self.loop)
|
||||
self.loop, None)
|
||||
h2 = asyncio.TimerHandle(time.monotonic() + 10.0, lambda: True, (),
|
||||
self.loop)
|
||||
self.loop, None)
|
||||
|
||||
h1.cancel()
|
||||
|
||||
|
@ -390,7 +390,7 @@ class BaseEventLoopTests(test_utils.TestCase):
|
|||
handle = loop.call_soon(lambda: True)
|
||||
|
||||
h = asyncio.TimerHandle(time.monotonic() - 1, cb, (self.loop,),
|
||||
self.loop)
|
||||
self.loop, None)
|
||||
|
||||
self.loop._process_events = mock.Mock()
|
||||
self.loop._scheduled.append(h)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue