mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-15 22:44:36 +00:00
standard-tests: Bump ruff version to 0.9 (#29230)
Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
committed by
GitHub
parent
e4a78dfc2a
commit
2340b3154d
@@ -137,7 +137,7 @@ class BaseStoreSyncTests(BaseStandardTests, Generic[V]):
|
||||
self, kv_store: BaseStore[str, V], three_values: Tuple[V, V, V]
|
||||
) -> None:
|
||||
"""Test that we can yield keys from the store."""
|
||||
foo, bar, buzz = three_values
|
||||
foo, bar, _buzz = three_values
|
||||
key_value_pairs = [("foo", foo), ("bar", bar)]
|
||||
kv_store.mset(key_value_pairs)
|
||||
|
||||
@@ -273,7 +273,7 @@ class BaseStoreAsyncTests(BaseStandardTests):
|
||||
self, kv_store: BaseStore[str, V], three_values: Tuple[V, V, V]
|
||||
) -> None:
|
||||
"""Test that we can yield keys from the store."""
|
||||
foo, bar, buzz = three_values
|
||||
foo, bar, _buzz = three_values
|
||||
key_value_pairs = [("foo", foo), ("bar", bar)]
|
||||
await kv_store.amset(key_value_pairs)
|
||||
|
||||
|
@@ -899,7 +899,10 @@ class ChatModelIntegrationTests(ChatModelTests):
|
||||
assert isinstance(result, AIMessage)
|
||||
|
||||
custom_model = self.chat_model_class(
|
||||
**{**self.chat_model_params, "stop": ["you"]}
|
||||
**{
|
||||
**self.chat_model_params,
|
||||
"stop": ["you"],
|
||||
}
|
||||
)
|
||||
result = custom_model.invoke("hi")
|
||||
assert isinstance(result, AIMessage)
|
||||
|
@@ -100,7 +100,10 @@ class ChatModelTests(BaseStandardTests):
|
||||
def model(self) -> BaseChatModel:
|
||||
""":private:"""
|
||||
return self.chat_model_class(
|
||||
**{**self.standard_chat_model_params, **self.chat_model_params}
|
||||
**{
|
||||
**self.standard_chat_model_params,
|
||||
**self.chat_model_params,
|
||||
}
|
||||
)
|
||||
|
||||
@pytest.fixture
|
||||
@@ -511,7 +514,10 @@ class ChatModelUnitTests(ChatModelTests):
|
||||
2. The model accommodates standard parameters: https://python.langchain.com/docs/concepts/chat_models/#standard-parameters
|
||||
""" # noqa: E501
|
||||
model = self.chat_model_class(
|
||||
**{**self.standard_chat_model_params, **self.chat_model_params}
|
||||
**{
|
||||
**self.standard_chat_model_params,
|
||||
**self.chat_model_params,
|
||||
}
|
||||
)
|
||||
assert model is not None
|
||||
|
||||
@@ -673,7 +679,7 @@ class ChatModelUnitTests(ChatModelTests):
|
||||
if not self.chat_model_class.is_lc_serializable():
|
||||
pytest.skip("Model is not serializable.")
|
||||
else:
|
||||
env_params, model_params, expected_attrs = self.init_from_env_params
|
||||
env_params, _model_params, _expected_attrs = self.init_from_env_params
|
||||
with mock.patch.dict(os.environ, env_params):
|
||||
ser = dumpd(model)
|
||||
assert ser == snapshot(name="serialized")
|
||||
|
Reference in New Issue
Block a user