Skip to content

[3.13] gh-155411: Fix test.support.subTests() for asynchronous tests (GH-155412) - #155546

Merged
serhiy-storchaka merged 4 commits into
python:3.13from
miss-islington:backport-198a835-3.13
Aug 12, 2026
Merged

[3.13] gh-155411: Fix test.support.subTests() for asynchronous tests (GH-155412)#155546
serhiy-storchaka merged 4 commits into
python:3.13from
miss-islington:backport-198a835-3.13

Conversation

@miss-islington

@miss-islington miss-islington commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

An asynchronous test was wrapped in a synchronous function, which
discarded the coroutine without awaiting it, so the test did not run at
all and was reported as successful.
(cherry picked from commit 198a835)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

…ythonGH-155412)

An asynchronous test was wrapped in a synchronous function, which
discarded the coroutine without awaiting it, so the test did not run at
all and was reported as successful.
(cherry picked from commit 198a835)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

# A synchronous wrapper would discard the coroutine without awaiting
# it, so an asynchronous test would not run at all.
if inspect.iscoroutinefunction(func):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll have to add an inspect import I think @serhiy-storchaka

@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) August 12, 2026 13:32
Running an event loop sets it, and regrtest reports it as a change of
the environment when the tests run in a single process.
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) August 12, 2026 14:23
@serhiy-storchaka
serhiy-storchaka merged commit f6dc38b into python:3.13 Aug 12, 2026
77 of 79 checks passed
@miss-islington
miss-islington deleted the backport-198a835-3.13 branch August 12, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants