← 返回首页
[3.10] gh-84753: Make inspect.iscoroutinefunction() work with AsyncMock (GH-94050) by miss-islington · Pull Request #94461 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

[3.10] gh-84753: Make inspect.iscoroutinefunction() work with AsyncMock (GH-94050)#94461

Merged
ambv merged 1 commit into
python:3.10from
miss-islington:backport-4261b6b-3.10
Jun 30, 2022
Merged

[3.10] gh-84753: Make inspect.iscoroutinefunction() work with AsyncMock (GH-94050)#94461
ambv merged 1 commit into
python:3.10from
miss-islington:backport-4261b6b-3.10

Conversation

miss-islington commented Jun 30, 2022
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

The inspect version was not working with unittest.mock.AsyncMock.

The fix introduces special-casing of AsyncMock in
inspect.iscoroutinefunction equivalent to the one
performed in asyncio.iscoroutinefunction.

Co-authored-by: Łukasz Langa lukasz@langa.pl
(cherry picked from commit 4261b6b)

Co-authored-by: Mehdi ABAAKOUK sileht@sileht.net

pythonGH-94050) The inspect version was not working with unittest.mock.AsyncMock. The fix introduces special-casing of AsyncMock in `inspect.iscoroutinefunction` equivalent to the one performed in `asyncio.iscoroutinefunction`. Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 4261b6b) Co-authored-by: Mehdi ABAAKOUK <sileht@sileht.net>

Copy link
Copy Markdown
Contributor Author

@sileht and @ambv: Status check is done, and it's a pending ❌ .

Copy link
Copy Markdown
Contributor Author

Status check is done, and it's a success ✅ .

1 similar comment

Copy link
Copy Markdown
Contributor Author

Status check is done, and it's a success ✅ .

ambv merged commit 47f23b2 into python:3.10 Jun 30, 2022
miss-islington deleted the backport-4261b6b-3.10 branch June 30, 2022 18:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants

Footer

© 2026 GitHub, Inc.