summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-02 22:59:28 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-02 22:59:28 (GMT)
commitb57d6a2fec3b0f2bb508ae3f3dcb9d6b54056fda (patch)
tree5a1fa1c25781204440052afc9c0ec979dc76ee76 /Lib/test
parent6680e9f5fd1015ec7630c7658b5fdcce93114ab4 (diff)
parent2dba23af7145f3edc608dc16209e6ead38c0f6c8 (diff)
downloadcpython-b57d6a2fec3b0f2bb508ae3f3dcb9d6b54056fda.zip
cpython-b57d6a2fec3b0f2bb508ae3f3dcb9d6b54056fda.tar.gz
cpython-b57d6a2fec3b0f2bb508ae3f3dcb9d6b54056fda.tar.bz2
(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
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index c64e1ef..83b7e61 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -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():