全部技能
generate-python-runnability-test
生成一个最小的 tests/test_runnability.py,导入 recipe 的 agent 模块并断言 root_agent 不为 None。
- 属于 google/adk-recipes
- 11次安装
- 开发工具 · 编程技能
适合什么时候用
你有一个带 agent.py 的 Python recipe,但缺少 tests/test_runnability.py,导致 python-validate-recipe.yml 因缺少必需文件而失败。
举个例子
你对 AI 说
用 generate-python-runnability-test 处理 core/python/cross-session-memory,先 dry-run 让我看看生成的测试再写入。
你会拿到
- tests/test_runnability.py
- dry-run 报告表格
- 生成的测试预览
它会怎么做
- 用 ast 解析 agent.py 和各级 __init__.py,判断需要 mock 哪些导入时副作用、设置哪些环境变量。
- 检查 recipe 根目录是否可导入,仅在需要时写入带路径垫片的 tests/conftest.py。
- 不加 --overwrite 不会覆盖已有的 tests/test_runnability.py,也从不覆盖已有的 tests/conftest.py。
安装前须知
这个技能带 3 个脚本,助手使用时可能会在你的电脑上运行它们。