-
Notifications
You must be signed in to change notification settings - Fork 56
LCORE-602: Fix unit-test warning #637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
```
.../assisted-chat/lightspeed-stack/src/authorization/middleware.py:91: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
if not access_resolver.check_access(action, user_roles):
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
```
`mock_access_resolver` is created as an `AsyncMock`, which makes all its
methods async by default, but `AccessResolver` `check_access` is sync
WalkthroughA test utility was updated: in mock_authorization_resolvers, mock_access_resolver is now a synchronous Mock instead of AsyncMock. Other mocked behaviors remain unchanged (roles resolve to empty set, access checks return True, actions getter returns a set of Action). Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
tests/{unit,integration}/**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
tests/**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
tisnik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
mock_access_resolveris created as anAsyncMock, which makes all itsmethods async by default, but
AccessResolvercheck_accessis syncType of change
Related Tickets & Documents
LCORE-602
Checklist before requesting a review
Testing
Summary by CodeRabbit