test(partners): account for warning behavior in partner tests (#38046)

Partner unit tests now reflect the warning behavior emitted by updated
`langchain-core` serialization and model initialization paths.
Warning-strict runs can stay focused on the behavior under test rather
than expected framework warnings.
This commit is contained in:
Mason Daugherty
2026-06-10 19:50:52 -04:00
committed by GitHub
parent 007ae66405
commit 21eeadf274
4 changed files with 7 additions and 4 deletions

View File

@@ -492,6 +492,7 @@ class TestSerialization:
"""Test that ChatOpenRouter declares itself as serializable."""
assert ChatOpenRouter.is_lc_serializable() is True
@pytest.mark.filterwarnings("ignore:The function `load` is in beta")
def test_dumpd_load_roundtrip(self) -> None:
"""Test that dumpd/load round-trip preserves model config."""
model = _make_model(temperature=0.7, max_tokens=100)

View File

@@ -346,7 +346,7 @@ wheels = [
[[package]]
name = "langchain-core"
version = "1.4.2"
version = "1.4.4"
source = { editable = "../../core" }
dependencies = [
{ name = "jsonpatch" },

View File

@@ -48,12 +48,14 @@ def test_chat_xai_invalid_streaming_params() -> None:
def test_chat_xai_extra_kwargs() -> None:
"""Test extra kwargs to chat xai."""
# Check that foo is saved in extra_kwargs.
llm = ChatXAI(model=MODEL_NAME, foo=3, max_tokens=10) # type: ignore[call-arg]
with pytest.warns(UserWarning, match="foo is not default parameter"):
llm = ChatXAI(model=MODEL_NAME, foo=3, max_tokens=10) # type: ignore[call-arg]
assert llm.max_tokens == 10
assert llm.model_kwargs == {"foo": 3}
# Test that if extra_kwargs are provided, they are added to it.
llm = ChatXAI(model=MODEL_NAME, foo=3, model_kwargs={"bar": 2}) # type: ignore[call-arg]
with pytest.warns(UserWarning, match="foo is not default parameter"):
llm = ChatXAI(model=MODEL_NAME, foo=3, model_kwargs={"bar": 2}) # type: ignore[call-arg]
assert llm.model_kwargs == {"foo": 3, "bar": 2}
# Test that if provided twice it errors

View File

@@ -679,7 +679,7 @@ wheels = [
[[package]]
name = "langchain-core"
version = "1.4.2"
version = "1.4.4"
source = { editable = "../../core" }
dependencies = [
{ name = "jsonpatch" },