summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_locks.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-38107: Replace direct future and task contructor calls with factories in ↵Andrew Svetlov2019-09-111-38/+38
| | | | asyncio tests (GH-15928)
* bpo-36373: Fix deprecation warnings (GH-15889)Andrew Svetlov2019-09-111-4/+3
| | | https://bugs.python.org/issue36373
* bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs ↵Emmanuel Arias2019-09-101-74/+124
| | | | | | | | | | | | | | | [locks] (GH-13920) This PR deprecate explicit loop parameters in all public asyncio APIs This issues is split to be easier to review. Third step: locks.py https://bugs.python.org/issue36373
* bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)Andrew Svetlov2019-05-161-38/+46
| | | | | | The second attempt. Now deprecate `@coroutine` only, keep `yield from fut` as is. https://bugs.python.org/issue36921
* bpo-34728: Fix asyncio tests to run under "-Werror" (GH-9661)Yury Selivanov2018-10-021-4/+3
|
* bpo-33562: Check the global asyncio event loop policy isn't set after any ↵Brett Cannon2018-06-021-0/+4
| | | | tests (GH-7328)
* bpo-32751: Wait for task cancellation in asyncio.wait_for() (GH-7216)Elvis Pranskevichus2018-05-291-0/+13
| | | | | | | | | | | | | | | | | | | | | | | Currently, asyncio.wait_for(fut), upon reaching the timeout deadline, cancels the future and returns immediately. This is problematic for when *fut* is a Task, because it will be left running for an arbitrary amount of time. This behavior is iself surprising and may lead to related bugs such as the one described in bpo-33638: condition = asyncio.Condition() async with condition: await asyncio.wait_for(condition.wait(), timeout=0.5) Currently, instead of raising a TimeoutError, the above code will fail with `RuntimeError: cannot wait on un-acquired lock`, because `__aexit__` is reached _before_ `condition.wait()` finishes its cancellation and re-acquires the condition lock. To resolve this, make `wait_for` await for the task cancellation. The tradeoff here is that the `timeout` promise may be broken if the task decides to handle its cancellation in a slow way. This represents a behavior change and should probably not be back-patched to 3.6 and earlier.
* bpo-32841: Fix cancellation in awaiting asyncio.Condition (#5665)Bar Harel2018-02-141-4/+27
|
* bpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466)Bar Harel2018-02-021-0/+50
|
* bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785)Yury Selivanov2017-12-111-1/+1
|
* bpo-32262: Fix codestyle; use f-strings formatting where necessary. (#4775)Yury Selivanov2017-12-101-2/+2
|
* bpo-32253: Deprecate with statement and bare await for asyncio locks (GH-4764)Andrew Svetlov2017-12-091-7/+40
| | | | | * Add test for 'with (yield from lock)' * Deprecate with statement for asyncio locks * Document the deprecation
* bpo-32193: Convert asyncio to async/await usage (#4753)Andrew Svetlov2017-12-081-73/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Convert asyncio/tasks.py to async/await * Convert asyncio/queues.py to async/await * Convert asyncio/test_utils.py to async/await * Convert asyncio/base_subprocess.py to async/await * Convert asyncio/subprocess.py to async/await * Convert asyncio/streams.py to async/await * Fix comments * Convert asyncio/locks.py to async/await * Convert asyncio.sleep to async def * Add a comment * Add missing news * Convert stubs from AbstrctEventLoop to async functions * Convert subprocess_shell/subprocess_exec * Convert connect_read_pipe/connect_write_pip to async/await syntax * Convert create_datagram_endpoint * Convert create_unix_server/create_unix_connection * Get rid of old style coroutines in unix_events.py * Convert selector_events.py to async/await * Convert wait_closed and create_connection * Drop redundant line * Convert base_events.py * Code cleanup * Drop redundant comments * Fix indentation * Add explicit tests for compatibility between old and new coroutines * Convert windows event loop to use async/await * Fix double awaiting of async function * Convert asyncio/locks.py * Improve docstring * Convert tests to async/await * Convert more tests * Convert more tests * Convert more tests * Convert tests * Improve test
* Fix waiter cancellation in asyncio.Lock (#1031)Mathieu Sornay2017-06-091-0/+22
| | | | | | Avoid a deadlock when the waiter who is about to take the lock is cancelled Issue #27585
* Issue #28613: Fix get_event_loop() to return the current loopYury Selivanov2016-11-041-0/+4
| | | | when called from coroutines or callbacks.
* Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-2/+2
|
* Issue #22970: asyncio: Fix inconsistency cancelling Condition.wait.Yury Selivanov2016-06-111-0/+25
| | | | Patch by David Coles.
* Also rewrote the guts of asyncio.Semaphore (patch by manipopopo).Guido van Rossum2015-09-291-9/+43
|
* asyncio: sync with TulipVictor Stinner2014-07-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | * _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
* Accept optional lock object in Condition ctor (tulip issue #198)Andrew Svetlov2014-07-261-0/+12
|
* Issue #21163, asyncio: Fix some "Task was destroyed but it is pending!" logs ↵Victor Stinner2014-06-251-0/+1
| | | | in tests
* asyncio: Refactor tests: add a base TestCase classVictor Stinner2014-06-171-48/+20
|
* asyncio: Replace "unittest.mock" with "mock" in unit testsVictor Stinner2014-02-261-10/+10
| | | | | 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: Locks refactor: use a separate context manager; remove ↵Guido van Rossum2014-01-261-0/+35
| | | | Semaphore._locked.
* Update asyncio from the Tulip projectVictor Stinner2014-01-251-123/+120
| | | | | | | | | | | | | | | | Major changes: - StreamReader.readexactly() now raises an IncompleteReadError if the end of stream is reached before we received enough bytes, instead of returning less bytes than requested. - Unit tests use the main asyncio module instead of submodules like events - _UnixWritePipeTransport now also supports character devices, as _UnixReadPipeTransport. Patch written by Jonathan Slenders. - Export more symbols: BaseEventLoop, BaseProactorEventLoop, BaseSelectorEventLoop, Queue and Queue sublasses, Empty, Full
* asyncio: Change bounded semaphore into a subclass, like ↵Guido van Rossum2013-11-231-1/+1
| | | | threading.[Bounded]Semaphore.
* asyncio: Make Semaphore(0) work properly.Guido van Rossum2013-11-211-0/+4
|
* asyncio: Locks improvements by Arnaud Faure: better repr(), change Conditio\Guido van Rossum2013-11-041-1/+70
| | | | n structure.
* Initial checkin of asyncio package (== Tulip, == PEP 3156).Guido van Rossum2013-10-171-0/+765