bito-code-review[bot] commented on code in PR #41924:
URL: https://github.com/apache/superset/pull/41924#discussion_r3573728158


##########
tests/unit_tests/mcp_service/semantic_layer/tool/test_list_metrics.py:
##########
@@ -309,3 +310,236 @@ async def 
test_list_metrics_pagination_is_stable(mcp_server: FastMCP) -> None:
 
     assert data_1["metrics"][0]["name"] == "aaa_metric"
     assert data_2["metrics"][0]["name"] == "zzz_metric"
+
+
[email protected]
+async def test_list_metrics_search_no_match_returns_empty(mcp_server: FastMCP) 
-> None:
+    """A search term that matches nothing returns an empty (not error) 
result."""
+    mock_ds = _make_dataset(1)

Review Comment:
   <!-- Bito Reply -->
   The suggestion to extract duplicate mock setup blocks into a pytest fixture 
is a valid and recommended improvement. By centralizing the setup for 
`DatasetDAO`, `SemanticViewDAO`, and `db` patches, you significantly reduce 
code duplication and improve the maintainability of your test suite. Applying 
this change will make the tests cleaner and easier to update if the mock 
requirements change in the future.



-- 
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]

Reply via email to