summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_tasks.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-29 10:58:59 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-29 10:58:59 (GMT)
commit00b39ffbd31da013171cb72b87b51c8efe839ed4 (patch)
treed3d1c7a80df5c01537825a86dcdfbe284a0425e1 /Lib/test/test_asyncio/test_tasks.py
parent205c2260894b4f627aec719aad30134b4efd4b76 (diff)
parent313a9809043ed2ed1ad25282af7169e08cdc92a3 (diff)
downloadcpython-00b39ffbd31da013171cb72b87b51c8efe839ed4.zip
cpython-00b39ffbd31da013171cb72b87b51c8efe839ed4.tar.gz
cpython-00b39ffbd31da013171cb72b87b51c8efe839ed4.tar.bz2
(Merge 3.4) asyncio: sync with Tulip
* _WaitHandleFuture.cancel() now notify IocpProactor through the overlapped object that the wait was cancelled. * Optimize IocpProactor.wait_for_handle() gets the result if the wait is signaled immediatly. * Enhance representation of Future and Future subclasses - Add "created at filename:lineno" in the representation - Add Future._repr_info() method which can be more easily overriden than Future.__repr__(). It should now be more easy to enhance Future representation without having to modify each subclass. For example, _OverlappedFuture and _WaitHandleFuture get the new "created at" information. - Use reprlib to format Future result, and function arguments when formatting a callback, to limit the length of the representation. * Fix repr(_WaitHandleFuture) * _WaitHandleFuture and _OverlappedFuture: hide frames of internal calls in the source traceback. * Cleanup ProactorIocp._poll(): set the timeout to 0 after the first call to GetQueuedCompletionStatus() * test_locks: close the temporary event loop and check the condition lock * Remove workaround in test_futures, no more needed
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index 7b93a0e..95cba54 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -132,6 +132,8 @@ class TaskTests(test_utils.TestCase):
asyncio.async('ok')
def test_task_repr(self):
+ self.loop.set_debug(False)
+
@asyncio.coroutine
def notmuch():
yield from []
@@ -189,6 +191,8 @@ class TaskTests(test_utils.TestCase):
"<Task finished %s result='abc'>" % coro)
def test_task_repr_coro_decorator(self):
+ self.loop.set_debug(False)
+
@asyncio.coroutine
def notmuch():
# notmuch() function doesn't use yield from: it will be wrapped by
@@ -252,6 +256,8 @@ class TaskTests(test_utils.TestCase):
self.loop.run_until_complete(t)
def test_task_repr_wait_for(self):
+ self.loop.set_debug(False)
+
@asyncio.coroutine
def wait_for(fut):
return (yield from fut)