summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_contextlib_async.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-95882: fix regression in the traceback of exceptions propagated from ↵Thomas Grainger2023-01-031-0/+57
| | | | inside a contextlib context manager (#95883)
* GH-89369: test_contextlib_async finalizes event loop after each test (#93074)Kumar Aditya2022-05-241-7/+4
| | | Use asyncio.run().
* gh-92118: Add test for traceback when exception is modified by ↵Irit Katriel2022-05-051-0/+7
| | | | (Async)ExitStack.__exit__ (GH-92339)
* bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)Christian Heimes2022-03-221-0/+1
| | | | | | | | | | | - Add requires_fork and requires_subprocess to more tests - Skip extension import tests if dlopen is not available - Don't assume that _testcapi is a shared extension - Skip a lot of socket tests that don't work on Emscripten - Skip mmap tests, mmap emulation is incomplete - venv does not work yet - Cannot get libc from executable The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).
* bpo-44594: fix (Async)ExitStack handling of __context__ (gh-27089)John Belmonte2021-10-041-0/+35
| | | | | | | | | * bpo-44594: fix (Async)ExitStack handling of __context__ Make enter_context(foo()) / enter_async_context(foo()) equivalent to `[async] with foo()` regarding __context__ when an exception is raised. Previously exceptions would be caught and re-raised with the wrong context when explicitly overriding __context__ with None.
* bpo-38415: Allow using @asynccontextmanager-made ctx managers as decorators ↵Jason Fried2021-09-231-0/+76
| | | | (GH-16667)
* bpo-44515: handle non-refcounted GC in contextlib tests (GH-26910)Nick Coghlan2021-07-261-6/+9
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44566: resolve differences between asynccontextmanager and ↵Thomas Grainger2021-07-201-1/+12
| | | | contextmanager (#27024)
* bpo-44471: Change error type for bad objects in ExitStack.enter_context() ↵Serhiy Storchaka2021-06-291-1/+33
| | | | | | | | | (GH-26820) A TypeError is now raised instead of an AttributeError in ExitStack.enter_context() and AsyncExitStack.enter_async_context() for objects which do not support the context manager or asynchronous context manager protocols correspondingly.
* bpo-44017: Update test_contextlib_async not to emit DeprecationWarn (GH-25918)Dong-hee Na2021-05-061-7/+5
|
* bpo-41543: contextlib.nullcontext can fill in for an async context manager ↵Tom Gringauz2020-11-091-1/+13
| | | | | (GH-21870) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-40816 Add AsyncContextDecorator class (GH-20516)Kazantcev Andrey2020-11-051-0/+27
| | | | Co-authored-by: Yury Selivanov <yury@edgedb.com>
* bpo-41229: Update docs for explicit aclose()-required cases and add ↵Joongi Kim2020-11-021-1/+58
| | | | | | | | | | | | | | | | | | | contextlib.aclosing() method (GH-21545) This is a PR to: * Add `contextlib.aclosing` which ia analogous to `contextlib.closing` but for async-generators with an explicit test case for [bpo-41229]() * Update the docs to describe when we need explicit `aclose()` invocation. which are motivated by the following issues, articles, and examples: * [bpo-41229]() * https://github.com/njsmith/async_generator * https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#cleanup-in-generators-and-async-generators * https://www.python.org/dev/peps/pep-0533/ * https://github.com/achimnol/aiotools/blob/ef7bf0cea7af/src/aiotools/context.py#L152 Particuarly regarding [PEP-533](https://www.python.org/dev/peps/pep-0533/), its acceptance (`__aiterclose__()`) would make this little addition of `contextlib.aclosing()` unnecessary for most use cases, but until then this could serve as a good counterpart and analogy to `contextlib.closing()`. The same applies for `contextlib.closing` with `__iterclose__()`. Also, still there are other use cases, e.g., when working with non-generator objects with `aclose()` methods.
* [3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)Serhiy Storchaka2019-06-051-2/+2
| | | Turn deprecation warnings added in 3.8 into TypeError.
* bpo-36492: Deprecate passing some arguments as keyword arguments. (GH-12637)Serhiy Storchaka2019-04-011-0/+10
| | | | | | | | | | | | | | | | | | | | | | Deprecated passing the following arguments as keyword arguments: - "func" in functools.partialmethod(), weakref.finalize(), profile.Profile.runcall(), cProfile.Profile.runcall(), bdb.Bdb.runcall(), trace.Trace.runfunc() and curses.wrapper(). - "function" in unittest.addModuleCleanup() and unittest.TestCase.addCleanup(). - "fn" in the submit() method of concurrent.futures.ThreadPoolExecutor and concurrent.futures.ProcessPoolExecutor. - "callback" in contextlib.ExitStack.callback(), contextlib.AsyncExitStack.callback() and contextlib.AsyncExitStack.push_async_callback(). - "c" and "typeid" in the create() method of multiprocessing.managers.Server and multiprocessing.managers.SharedMemoryServer. - "obj" in weakref.finalize(). Also allowed to pass arbitrary keyword arguments (even "self" and "func") if the above arguments are passed as positional argument.
* bpo-34183: Fix running Lib/test/test_contextlib_async.py as a script. (GH-8381)Serhiy Storchaka2018-07-231-1/+1
|
* bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() ↵Yury Selivanov2018-06-081-0/+22
| | | | (GH-7467)
* bpo-33562: Check the global asyncio event loop policy isn't set after any ↵Brett Cannon2018-06-021-1/+2
| | | | tests (GH-7328)
* bpo-29302: Implement contextlib.AsyncExitStack. (#4790)Ilya Kulakov2018-01-251-1/+166
|
* bpo-30241: implement contextlib.AbstractAsyncContextManager (#1412)Jelle Zijlstra2017-12-141-1/+48
|
* bpo-29679: Implement @contextlib.asynccontextmanager (#360)Jelle Zijlstra2017-05-011-0/+212