mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 19:47:13 +00:00
community[patch]: upgrade to recent version of mypy (#21616)
This PR upgrades community to a recent version of mypy. It inserts type: ignore on all existing failures.
This commit is contained in:
@@ -9,7 +9,7 @@ from langchain_community.llms.minimax import Minimax
|
||||
|
||||
|
||||
def test_api_key_is_secret_string() -> None:
|
||||
llm = Minimax(minimax_api_key="secret-api-key", minimax_group_id="group_id")
|
||||
llm = Minimax(minimax_api_key="secret-api-key", minimax_group_id="group_id") # type: ignore[arg-type, call-arg]
|
||||
assert isinstance(llm.minimax_api_key, SecretStr)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ def test_api_key_masked_when_passed_from_env(
|
||||
"""Test initialization with an API key provided via an env variable"""
|
||||
monkeypatch.setenv("MINIMAX_API_KEY", "secret-api-key")
|
||||
monkeypatch.setenv("MINIMAX_GROUP_ID", "group_id")
|
||||
llm = Minimax()
|
||||
llm = Minimax() # type: ignore[call-arg]
|
||||
print(llm.minimax_api_key, end="") # noqa: T201
|
||||
captured = capsys.readouterr()
|
||||
|
||||
@@ -30,7 +30,7 @@ def test_api_key_masked_when_passed_via_constructor(
|
||||
capsys: CaptureFixture,
|
||||
) -> None:
|
||||
"""Test initialization with an API key provided via the initializer"""
|
||||
llm = Minimax(minimax_api_key="secret-api-key", minimax_group_id="group_id")
|
||||
llm = Minimax(minimax_api_key="secret-api-key", minimax_group_id="group_id") # type: ignore[arg-type, call-arg]
|
||||
print(llm.minimax_api_key, end="") # noqa: T201
|
||||
captured = capsys.readouterr()
|
||||
|
||||
@@ -39,5 +39,5 @@ def test_api_key_masked_when_passed_via_constructor(
|
||||
|
||||
def test_uses_actual_secret_value_from_secretstr() -> None:
|
||||
"""Test that actual secret is retrieved using `.get_secret_value()`."""
|
||||
llm = Minimax(minimax_api_key="secret-api-key", minimax_group_id="group_id")
|
||||
llm = Minimax(minimax_api_key="secret-api-key", minimax_group_id="group_id") # type: ignore[arg-type, call-arg]
|
||||
assert cast(SecretStr, llm.minimax_api_key).get_secret_value() == "secret-api-key"
|
||||
|
Reference in New Issue
Block a user