Skip to content

Commit 3822ea5

Browse files
committed
fix(tests): skip langmem tests on Python 3.10
Add Python version check to skip langmem serialization tests on Python < 3.11. The langmem library uses typing.NotRequired which was introduced in Python 3.11, causing import failures on Python 3.10 in CI. Tests will: - Skip on Python 3.10 (379 tests run) - Run on Python 3.11+ (382 tests run) Fixes CI test collection failures on Python 3.10.
1 parent a24a825 commit 3822ea5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/test_langmem_serialization.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
"""Integration tests for langmem object serialization with JsonPlusRedisSerializer."""
22

3+
import sys
4+
35
import pytest
4-
from langmem.short_term.summarization import RunningSummary
56

67
from langgraph.checkpoint.redis.jsonplus_redis import JsonPlusRedisSerializer
78

9+
# langmem requires Python 3.11+ (uses typing.NotRequired)
10+
# Use importorskip to skip the entire module if langmem can't be imported
11+
RunningSummary = pytest.importorskip(
12+
"langmem.short_term.summarization",
13+
reason="langmem requires Python 3.11+ (uses typing.NotRequired)",
14+
).RunningSummary
15+
816

917
class TestLangmemSerialization:
1018
"""Test that langmem objects are properly serialized and deserialized."""

0 commit comments

Comments
 (0)