bito-code-review[bot] commented on PR #41920:
URL: https://github.com/apache/superset/pull/41920#issuecomment-4932223054
<!-- Bito Reply -->
The current test implementation is indeed brittle because it asserts an
exact count of awaits (`await_count == 2`) and relies on positional indexing of
the `await_args_list`. To make the test more robust while still verifying that
the required log lines are awaited, you can iterate through the
`await_args_list` and check for the presence of the expected messages,
regardless of the total number of calls.
Here is a suggested update for the test logic:
**tests/unit_tests/mcp_service/dashboard/tool/test_update_dashboard.py**
```
# ... (previous test setup)
assert mock_ctx_info.await_count >= 2
awaited_messages = [call.args[0] for call in
mock_ctx_info.await_args_list]
assert any("Updating dashboard" in msg for msg in awaited_messages)
assert any("updated" in msg for msg in awaited_messages)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]