mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-27 06:18:05 +00:00
standard-tests[patch]: resolve pydantic warnings (#26190)
This commit is contained in:
@@ -46,6 +46,9 @@ markers = [
|
||||
"scheduled: mark tests to run in scheduled testing",
|
||||
]
|
||||
asyncio_mode = "auto"
|
||||
filterwarnings = [
|
||||
"ignore::langchain_core._api.beta_decorator.LangChainBetaWarning",
|
||||
]
|
||||
|
||||
[tool.poetry.group.test]
|
||||
optional = true
|
||||
|
@@ -633,7 +633,9 @@ def test_bind_tools_tool_choice(tool_choice: Any, strict: Optional[bool]) -> Non
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("schema", [GenerateUsername, GenerateUsername.schema()])
|
||||
@pytest.mark.parametrize(
|
||||
"schema", [GenerateUsername, GenerateUsername.model_json_schema()]
|
||||
)
|
||||
@pytest.mark.parametrize("method", ["json_schema", "function_calling", "json_mode"])
|
||||
@pytest.mark.parametrize("include_raw", [True, False])
|
||||
@pytest.mark.parametrize("strict", [True, False, None])
|
||||
|
@@ -79,7 +79,8 @@ def my_adder(a: int, b: int) -> int:
|
||||
class ChatModelTests(BaseStandardTests):
|
||||
@property
|
||||
@abstractmethod
|
||||
def chat_model_class(self) -> Type[BaseChatModel]: ...
|
||||
def chat_model_class(self) -> Type[BaseChatModel]:
|
||||
...
|
||||
|
||||
@property
|
||||
def chat_model_params(self) -> dict:
|
||||
@@ -187,7 +188,12 @@ class ChatModelUnitTests(ChatModelTests):
|
||||
tools = [my_adder_tool, my_adder]
|
||||
|
||||
for pydantic_model in TEST_PYDANTIC_MODELS:
|
||||
tools.extend([pydantic_model, pydantic_model.schema()])
|
||||
model_schema = (
|
||||
pydantic_model.model_json_schema()
|
||||
if hasattr(pydantic_model, "model_json_schema")
|
||||
else pydantic_model.schema()
|
||||
)
|
||||
tools.extend([pydantic_model, model_schema])
|
||||
|
||||
# Doing a mypy ignore here since some of the tools are from pydantic
|
||||
# BaseModel 2 which isn't typed properly yet. This will need to be fixed
|
||||
|
@@ -82,3 +82,4 @@ markers = [
|
||||
"compile: mark placeholder test used to compile integration tests without running them",
|
||||
]
|
||||
asyncio_mode = "auto"
|
||||
|
||||
|
Reference in New Issue
Block a user