mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
(Merge 3.4) asyncio: sync with Tulip
* _UnixSubprocessTransport: fix file mode of stdin. Open stdin in write mode, not in read mode * Examples: close the event loop at exit * More reliable CoroWrapper.__del__. If the constructor is interrupted by KeyboardInterrupt or the coroutine objet is destroyed lately, some the _source_traceback attribute doesn't exist anymore. * repr(Task): include also the future the task is waiting for
This commit is contained in:
commit
b57d6a2fec
4 changed files with 23 additions and 7 deletions
|
@ -218,6 +218,17 @@ class TaskTests(test_utils.TestCase):
|
|||
'<Task pending %s cb=[<Dummy>()]>' % coro)
|
||||
self.loop.run_until_complete(t)
|
||||
|
||||
def test_task_repr_wait_for(self):
|
||||
@asyncio.coroutine
|
||||
def wait_for(fut):
|
||||
return (yield from fut)
|
||||
|
||||
fut = asyncio.Future(loop=self.loop)
|
||||
task = asyncio.Task(wait_for(fut), loop=self.loop)
|
||||
test_utils.run_briefly(self.loop)
|
||||
self.assertRegex(repr(task),
|
||||
'<Task .* wait_for=%s>' % re.escape(repr(fut)))
|
||||
|
||||
def test_task_basics(self):
|
||||
@asyncio.coroutine
|
||||
def outer():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue