Skip to content

[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

ambv merged 1 commit into
python:3.10from
miss-islington:backport-4261b6b-3.10

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 30, 2022 •

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>
@miss-islington

Copy link
Copy Markdown
Contributor Author

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

@miss-islington

Copy link
Copy Markdown
Contributor Author

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

1 similar comment
@miss-islington

Copy link
Copy Markdown
Contributor Author

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

@ambv
ambv merged commit 47f23b2 into python:3.10 Jun 30, 2022
@miss-islington
miss-islington deleted the backport-4261b6b-3.10 branch June 30, 2022 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants