Write regression tests for FastMCP changes using its pytest fixtures, in-memory clients, and protocol boundaries.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-python-tests-ae96ec965fde ,按照其中的说明把「python-tests」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Read nearby tests and the repository's validation requirements first. Extend the owning test module when it remains readable; use a focused module when the existing one is already too large.
For a bug fix, run the regression against unchanged code and confirm it fails for the reported reason, then run it with the fix. An import error or broken fixture is not a reproduced bug. Include supported adjacent behavior that the same branch could change, especially omitted defaults and explicit overrides.
asyncio_mode = "auto" is configured globally.Client(server) for real MCP dispatch without a network server. Use HTTP transport only when network behavior is the subject.httpx2.MockTransport and assert its bytes, headers, or decoded parameters.tmp_path for files.True from 1: check the resulting type when type preservation matters.inline_snapshot conventions for complex schema assertions. Inspect generated snapshots rather than accepting them blindly.Run focused tests during development, then the full commands required by AGENTS.md before committing. If a failure appears unrelated, reproduce it on the unchanged base; do not call it pre-existing from the test name alone.