| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
its executor (GH-91680)
For things like test_asyncio.test_thread this was causing frequent
"environment modified by test" errors as the executor threads had not
always stopped running after the test was over.
|
|
|
|
|
|
|
|
| |
(GH-30198) (GH-30202)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>.
(cherry picked from commit 9c06fd89514a9a2865e2adcc472095f6949cecb2)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
|
|
|
|
|
|
|
| |
Fix typos in the Lib directory as identified by codespell.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>.
(cherry picked from commit 745c9d9dfc1ad6fdfdf1d07420c6273ff67fa5be)
Co-authored-by: Christian Clauss <cclauss@me.com>
|
|
|
|
|
|
|
|
|
|
| |
(GH-28521)
It runs now asynchronous methods and callbacks.
If it fails, doCleanups() can be called for cleaning up.
(cherry picked from commit ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
leaked tasks (GH-27765)
(cherry picked from commit 2cb1a6806c0cefab0c3a40fdd428a89a4392570e)
Co-authored-by: Bar Harel <bar.harel@biocatch.com>
|
| |
|
|
|
| |
https://bugs.python.org/issue36373
|
|
Add explicit `asyncSetUp` and `asyncTearDown` methods.
The rest is the same as for #13228
`AsyncTestCase` create a loop instance for every test for the sake of test isolation.
Sometimes a loop shared between all tests can speed up tests execution time a lot but it requires control of closed resources after every test finish. Basically, it requires nested supervisors support that was discussed with @1st1 many times. Sorry, asyncio supervisors have no chance to land on Python 3.8.
The PR intentionally does not provide API for changing the used event loop or getting the test loop: use `asyncio.set_event_loop_policy()` and `asyncio.get_event_loop()` instead.
The PR adds four overridable methods to base `unittest.TestCase` class:
```
def _callSetUp(self):
self.setUp()
def _callTestMethod(self, method):
method()
def _callTearDown(self):
self.tearDown()
def _callCleanup(self, function, /, *args, **kwargs):
function(*args, **kwargs)
```
It allows using asyncio facilities with minimal influence on the unittest code.
The last but not least: the PR respects contextvars. The context variable installed by `asyncSetUp` is available on test, `tearDown` and a coroutine scheduled by `addCleanup`.
https://bugs.python.org/issue32972
|