File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,12 @@ def test_cython_coro_is_coroutine(self):
426
426
_format_coroutine (coro ) # This line checks against Cython segfault
427
427
coro .close ()
428
428
429
+ def test_loop_create_future (self ):
430
+ fut = self .loop .create_future ()
431
+ self .assertTrue (isinstance (fut , asyncio .Future ))
432
+ self .assertIs (fut ._loop , self .loop )
433
+ fut .cancel ()
434
+
429
435
430
436
class TestBaseAIO (_TestBase , AIOTestCase ):
431
437
pass
Original file line number Diff line number Diff line change @@ -946,6 +946,10 @@ cdef class Loop:
946
946
""" Returns True if the event loop was closed."""
947
947
return bool (self ._closed)
948
948
949
+ def create_future (self ):
950
+ """ Create a Future object attached to the loop."""
951
+ return self ._new_future()
952
+
949
953
def create_task (self , coro ):
950
954
""" Schedule a coroutine object.
951
955
You can’t perform that action at this time.
0 commit comments