Skip to content

Commit

Permalink
type ignores for mocking methods
Browse files Browse the repository at this point in the history
  • Loading branch information
maxjakob committed May 3, 2024
1 parent dedc31b commit e41dca1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/elasticsearch/tests/unit_tests/test_vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def test_agent_header(self, store: ElasticsearchStore) -> None:
def test_similarity_search(
self, store: ElasticsearchStore, static_hits: List[Dict]
) -> None:
store._store.search = Mock(return_value=static_hits)
store._store.search = Mock(return_value=static_hits) # type: ignore[assignment]
actual1 = store.similarity_search(
query="test",
k=7,
Expand All @@ -210,7 +210,7 @@ def test_similarity_search(
custom_query=self.dummy_custom_query,
)

store._store.search = Mock(return_value=static_hits)
store._store.search = Mock(return_value=static_hits) # type: ignore[assignment]

actual2 = store.similarity_search_with_score(
query="test",
Expand All @@ -230,7 +230,7 @@ def test_similarity_search(
def test_similarity_search_by_vector_with_relevance_scores(
self, store: ElasticsearchStore, static_hits: List[Dict]
) -> None:
store._store.search = Mock(return_value=static_hits)
store._store.search = Mock(return_value=static_hits) # type: ignore[assignment]
actual = store.similarity_search_by_vector_with_relevance_scores(
embedding=[1, 2, 3],
k=7,
Expand Down Expand Up @@ -333,7 +333,7 @@ def test_max_marginal_relevance_search(
embeddings: Embeddings,
static_hits: List[Dict],
) -> None:
hybrid_store._store.max_marginal_relevance_search = Mock(
hybrid_store._store.max_marginal_relevance_search = Mock( # type: ignore[assignment]
return_value=static_hits
)
actual = hybrid_store.max_marginal_relevance_search(
Expand Down

0 comments on commit e41dca1

Please sign in to comment.