Skip to content
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

enhance: Print results if a test fails #37606

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/python_client/testcases/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -12091,6 +12091,13 @@ def test_hybrid_search_different_limit_round_decimal(self, primary_field, limit)
# 6. compare results through the re-calculated distances
for i in range(len(score_answer[:limit])):
delta = math.fabs(score_answer[i] - hybrid_res[0].distances[i])
if delta >= hybrid_search_epsilon:
# print id and distance for debug
# answer and hybrid search result
for i1 in range(len(score_answer)):
log.info("answer id: %d, distance: %f" % (ids_answer[i1], score_answer[i1]))
for i2 in range(len(hybrid_res[0].ids)):
log.info("hybrid search res id: %d, distance: %f" % (hybrid_res[0].ids[i2], hybrid_res[0].distances[i2]))
assert delta < hybrid_search_epsilon

@pytest.mark.tags(CaseLabel.L1)
Expand Down