tests/test_example_postgres_session_store.py: 同步测试依赖于异步固定项,因此在 pytest 9 中在设置时出现模块错误

作者: codyanthony736创建于 2026年9月14日更新于 2026年9月14日
标签bug

`tests/test_example_postgres_session_store.py` 中有两个同步测试,它们依赖异步装置:`test_store_implements_required_methods`(第 145 行,装置为 `store`)和 `test_rejects_unsafe_table_name`(第 154 行,装置为 `pool`)。pytest 在 8.4 版中废弃了依赖异步装置的同步测试,并在 9.0 版中将其定为错误,并且 `dev` 附加项 `pytest>=7.0.0` 没有上限,因此使用 `pip install -e ".[dev,examples]"` 可安装 pytest 9.1.1。

内容来源: anthropics/claude-agent-sdk-python