Skip to content

Commit

Permalink
Removed test for deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
willtai committed Sep 30, 2024
1 parent 3ae3c6a commit 6f87ec3
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions tests/unit/test_graphrag.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from unittest.mock import MagicMock
from warnings import catch_warnings

import pytest
from neo4j_graphrag.exceptions import RagInitializationError, SearchValidationError
Expand All @@ -22,7 +21,6 @@
from neo4j_graphrag.generation.types import RagResultModel
from neo4j_graphrag.llm import LLMResponse
from neo4j_graphrag.types import RetrieverResult, RetrieverResultItem
from pydantic import ValidationError


def test_graphrag_prompt_template() -> None:
Expand Down Expand Up @@ -101,21 +99,3 @@ def test_graphrag_search_error(retriever_mock: MagicMock, llm: MagicMock) -> Non
with pytest.raises(SearchValidationError) as excinfo:
rag.search(10) # type: ignore
assert "Input should be a valid string" in str(excinfo)


def test_graphrag_search_query_deprecation_warning(
retriever_mock: MagicMock, llm: MagicMock
) -> None:
with catch_warnings(record=True) as warn_list:
rag = GraphRAG(
retriever=retriever_mock,
llm=llm,
)
with pytest.raises(ValidationError):
rag.search(query_text="Some query text")

assert len(warn_list) == 1
assert (
str(warn_list[0].message)
== "'query' is deprecated and will be removed in a future version, please use 'query_text' instead."
)

0 comments on commit 6f87ec3

Please sign in to comment.