mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-10-15 04:35:26 +02:00
The conformance self-test in `libs/checkpoint-conformance` ran every capability against `InMemorySaver` but asserted only the base ones. `libs/checkpoint/tests/test_conformance_delta.py`, which ran the delta conformance tests against it, always skips in CI: `libs/checkpoint` can't depend on the conformance package, which depends on it. So no CI job checked `InMemorySaver.get_delta_channel_history` against the delta conformance tests. The self-test now asserts every capability `InMemorySaver` implements, and the skipped copy is gone. ## Tests - With `InMemorySaver.get_delta_channel_history` broken to return no history, the self-test now fails on 7 of the 10 delta conformance tests; on main it still passes. - `make format`, `make lint` and `make test` pass in `libs/checkpoint-conformance`.
22 lines
635 B
Python
22 lines
635 B
Python
"""Self-tests: run the conformance suite against InMemorySaver."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
from langgraph.checkpoint.memory import InMemorySaver
|
|
|
|
from langgraph.checkpoint.conformance import checkpointer_test, validate
|
|
|
|
|
|
@checkpointer_test(name="InMemorySaver")
|
|
async def memory_checkpointer():
|
|
yield InMemorySaver()
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_validate_memory():
|
|
"""InMemorySaver passes the tests of every capability it implements."""
|
|
report = await validate(memory_checkpointer)
|
|
report.print_report()
|
|
assert report.passed_all(), f"Capability tests failed: {report.to_dict()}"
|