summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/test_utils.py
Commit message (Collapse)AuthorAgeFilesLines
* asyncio: Skip getaddrinfo if host is already resolved.Yury Selivanov2015-12-171-2/+7
| | | | | | | | | | | | | getaddrinfo takes an exclusive lock on some platforms, causing clients to queue up waiting for the lock if many names are being resolved concurrently. Users may want to handle name resolution in their own code, for the sake of caching, using an alternate resolver, or to measure DNS duration separately from connection duration. Skip getaddrinfo if the "host" passed into create_connection is already resolved. See https://github.com/python/asyncio/pull/302 for details. Patch by A. Jesse Jiryu Davis.
* asyncio: Fix with githubYury Selivanov2015-11-201-0/+11
| | | | See https://github.com/python/asyncio/pull/295 for details
* Issue #25593: Change semantics of EventLoop.stop().Guido van Rossum2015-11-191-5/+6
|
* Issue #23353, asyncio: Workaround CPython bug #23353Victor Stinner2015-02-021-0/+4
| | | | | Don't use yield/yield-from in an except block of a generator. Store the exception and handle it outside the except block.
* asyncio: sync with TulipVictor Stinner2015-01-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | * PipeHandle now uses None instead of -1 for a closed handle * Sort imports in windows_utils. * Fix test_events on Python older than 3.5. Skip SSL tests on the ProactorEventLoop if ssl.MemoryIO is missing * Fix BaseEventLoop._create_connection_transport(). Close the transport if the creation of the transport (if the waiter) gets an exception. * _ProactorBasePipeTransport now sets _sock to None when the transport is closed. * Fix BaseSubprocessTransport.close(). Ignore pipes for which the protocol is not set yet (still equal to None). * TestLoop.close() now calls the close() method of the parent class (BaseEventLoop). * Cleanup BaseSelectorEventLoop: create the protocol on a separated line for readability and ease debugging. * Fix BaseSubprocessTransport._kill_wait(). Set the _returncode attribute, so close() doesn't try to terminate the process. * Tests: explicitly close event loops and transports * UNIX pipe transports: add closed/closing in repr(). Add "closed" or "closing" state in the __repr__() method of _UnixReadPipeTransport and _UnixWritePipeTransport classes.
* Issue #22560: New SSL implementation based on ssl.MemoryBIOVictor Stinner2015-01-131-0/+5
| | | | | | | | | | | | | | | | | | | The new SSL implementation is based on the new ssl.MemoryBIO which is only available on Python 3.5. On Python 3.4 and older, the legacy SSL implementation (using SSL_write, SSL_read, etc.) is used. The proactor event loop only supports the new implementation. The new asyncio.sslproto module adds _SSLPipe, SSLProtocol and _SSLProtocolTransport classes. _SSLPipe allows to "wrap" or "unwrap" a socket (switch between cleartext and SSL/TLS). Patch written by Antoine Pitrou. sslproto.py is based on gruvi/ssl.py of the gruvi project written by Geert Jansen. This change adds SSL support to ProactorEventLoop on Python 3.5 and newer! It becomes also possible to implement STARTTTLS: switch a cleartext socket to SSL.
* Issue #22641: In asyncio, the default SSL context for client connections is ↵Antoine Pitrou2014-10-151-1/+12
| | | | now created using ssl.create_default_context(), for stronger security.
* asyncio: sync with TulipVictor Stinner2014-08-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | * PipeServer.close() now cancels the "accept pipe" future which cancels the overlapped operation. * Fix _SelectorTransport.__repr__() if the transport was closed * Fix debug log in BaseEventLoop.create_connection(): get the socket object from the transport because SSL transport closes the old socket and creates a new SSL socket object. Remove also the _SelectorSslTransport._rawsock attribute: it contained the closed socket (not very useful) and it was not used. * Issue #22063: socket operations (sock_recv, sock_sendall, sock_connect, sock_accept) of the proactor event loop don't raise an exception in debug mode if the socket are in blocking mode. Overlapped operations also work on blocking sockets. * Fix unit tests in debug mode: mock a non-blocking socket for socket operations which now raise an exception if the socket is blocking. * _fatal_error() method of _UnixReadPipeTransport and _UnixWritePipeTransport now log all exceptions in debug mode * Don't log expected errors in unit tests * Tulip issue 200: _WaitHandleFuture._unregister_wait() now catchs and logs exceptions. * Tulip issue 200: Log errors in debug mode instead of simply ignoring them.
* asyncio tests: make quiet the logs of SSL handshake failures when running testsVictor Stinner2014-07-141-0/+16
| | | | in debug mode
* asyncio: sync with TulipVictor Stinner2014-07-081-1/+1
| | | | | | | | | | | - Tulip issue 185: Add a create_task() method to event loops. The create_task() method can be overriden in custom event loop to implement their own task class. For example, greenio and Pulsar projects use their own task class. The create_task() method is now preferred over creating directly task using the Task class. - tests: fix a warning - fix typo in the name of a test function - Update AbstractEventLoop: add new event loop methods; update also the unit test
* Issue #21163: BaseEventLoop.run_until_complete() and test_utils.run_briefly()Victor Stinner2014-06-301-0/+3
| | | | | don't log the "destroy pending task" message anymore. The log is redundant for run_until_complete() and useless in run_briefly().
* asyncio: sync with Tulip, add a new asyncio.coroutines moduleVictor Stinner2014-06-281-1/+2
|
* asyncio: Refactor tests: add a base TestCase classVictor Stinner2014-06-171-0/+18
|
* asyncio: Tulip issue 173: Enhance repr(Handle) and repr(Task)Victor Stinner2014-06-121-0/+7
| | | | | | | | | | repr(Handle) is shorter for function: "foo" instead of "<function foo at 0x...>". It now also includes the source of the callback, filename and line number where it was defined, if available. repr(Task) now also includes the current position in the code, filename and line number, if available. If the coroutine (generator) is done, the line number is omitted and "done" is added.
* asyncio, Tulip issue 157: Improve test_events.py, avoid run_briefly() which isVictor Stinner2014-03-061-9/+6
| | | | not reliable
* asyncio: Fix pyflakes warnings: remove unused variables and importsVictor Stinner2014-02-261-1/+0
|
* asyncio: Replace "unittest.mock" with "mock" in unit testsVictor Stinner2014-02-261-2/+2
| | | | | Use "from unittest import mock". It should simplify my work to merge new tests in Trollius, because Trollius uses "mock" backport for Python 2.
* asyncio: remove unused imports and unused variables noticed by pyflakesVictor Stinner2014-02-201-1/+1
|
* asyncio: Fix spelling and typos.Yury Selivanov2014-02-191-2/+2
| | | | Thanks to Vajrasky Kok for discovering some of them.
* asyncio: New error handling API. Issue #20681.Yury Selivanov2014-02-181-2/+16
|
* asyncio: Add support for UNIX Domain Sockets.Yury Selivanov2014-02-181-34/+119
|
* asyncio, Tulip issue 126: call_soon(), call_soon_threadsafe(), call_later(),Victor Stinner2014-02-111-1/+4
| | | | | call_at() and run_in_executor() now raise a TypeError if the callback is a coroutine function.
* Issue #20505: Fix TestLoop, set the clock resolutionVictor Stinner2014-02-111-0/+1
|
* asyncio: Tulip issue 112: Inline make_handle() into Handle constructorVictor Stinner2014-02-091-2/+2
|
* asyncio: Remove more relics of resolution/granularity.Guido van Rossum2014-02-091-5/+0
|
* asyncio: Fix granularity of test_utils.TestLoop.Victor Stinner2014-01-311-0/+1
|
* Fix asyncio tests: define resolutionVictor Stinner2014-01-251-0/+4
|
* asyncio: remove references to the Tulip project, rename Tulip to asyncio.Victor Stinner2013-12-131-1/+1
| | | | Patch written by Vajrasky Kok.
* Remove a duplicated importVictor Stinner2013-12-071-1/+0
|
* asyncio: Add Task.current_task() class method.Guido van Rossum2013-12-061-1/+1
|
* fix cert names for asyncio testChristian Heimes2013-12-061-2/+2
|
* Issue #19842: Refactor BaseSelector to make it an actual usable ABC.Charles-François Natali2013-12-011-0/+14
|
* Close #19297: fix resource warnings in test_asyncio. Patch by Vajrasky Kok.Antoine Pitrou2013-10-201-0/+1
|
* Issue #19305: try to fix sporadic test_asyncio failure on FreeBSD 10.0Antoine Pitrou2013-10-191-0/+15
|
* Initial checkin of asyncio package (== Tulip, == PEP 3156).Guido van Rossum2013-10-171-0/+246