summaryrefslogtreecommitdiff
path: root/tests/test_tasks.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-01 20:23:39 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-07-01 20:23:39 +0200
commit7cebdfd473f704ac6179012af16ac4bf326de505 (patch)
tree5b9acaa97d3066e2591f8754ea5403f5cfb40b5e /tests/test_tasks.py
parent1126845f7bed3b039e5862fe1679ac2fe337231a (diff)
downloadtrollius-7cebdfd473f704ac6179012af16ac4bf326de505.tar.gz
repr(Task): include also the future the task is waiting for
Diffstat (limited to 'tests/test_tasks.py')
-rw-r--r--tests/test_tasks.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_tasks.py b/tests/test_tasks.py
index c64e1ef..83b7e61 100644
--- a/tests/test_tasks.py
+++ b/tests/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():