Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@994125010
Copy link
Contributor

@994125010 994125010 commented Jun 4, 2025

We introduced asynq_to_async module but didn't add tests for mocks.

When using asynq with .asyncio in conjunction with asynq.mock_.patch on an @asynq() decorated function, the .asyncio accessor leads to a a MagicMock and can't be awaited

This fixes that and adds unit tests

994125010 added 2 commits June 4, 2025 05:32
Reviewers: dkang

Test Plan: unit tests

Differential Revision:

Asana Tasks:

Screenshot:

CC:

Deploy To:
# so we can also mock non-functions for compatibility
if callable(mock_fn):
async_fn = _AsyncWrapper(mock_fn)
async_fn = _AsynqWrapper(mock_fn)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed this since the attribute had to be renamed asynq to not be confused with async keyword

@994125010 994125010 merged commit ea2e317 into master Jun 4, 2025
20 checks passed
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