pytest-auto-api2

Automate YAML-based API test case workflows with Pytest and CaseGo.

23|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/dawei12138/casego-backend-pg --skill pytest-auto-api2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-auto-api2
Source: https://github.com/dawei12138/casego-backend-pg/tree/main/CaseGo/skills/pytest-auto-api2
Command: npx skills add https://github.com/dawei12138/casego-backend-pg --skill pytest-auto-api2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

将 YAML 基于的 API 测试用例的编写、校验、生成与执行过程整合为一个可复用的技能,降低上手门槛并提升稳定性。

Core Features & Use Cases

  • YAML 用例规范化:提供清晰的字段定义、依赖与断言模板,帮助团队快速编写可执行的测试用例。
  • 全流程自动化:覆盖用例初始化、校验、生成测试代码与执行,以及 conftest 登录鉴权(Cookie/Token)的实战模板。
  • 兼容实战场景:支持本地开发与持续集成环境中的快速验证与调试。
  • Use Case: 在一个 API 测试套件中,使用 YAML 编排测试用例、依赖关系与缓存,自动生成对应的 pytest 用例并执行以产出报告。

Quick Start

使用本技能快速搭建一个基于 YAML 的测试工程,并通过 casego 的 validate、gen、run 流程实现用例生成、校验与执行。

Frequently Asked Questions about pytest-auto-api2

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate YAML API test case execution with pytest?

To automate YAML API test execution with pytest, define test cases in YAML and use Casego to validate, generate pytest code, and run them locally or in CI environments for deterministic results.

How does conftest handle login authentication for API testing?

Conftest handles login authentication for API testing by implementing session-based strategies using Cookie or Token, ensuring deterministic and repeatable test results across your YAML test suites.

What YAML structure is required for pytest API test cases?

The required YAML structure for pytest API test cases includes specific frontmatter fields, dependency templates, and assertion definitions to ensure proper initialization, validation, and generation of executable test code.

Can I run YAML-based pytest test suites in a CI environment?

Yes, you can run YAML-based pytest test suites in a CI environment, as the workflow supports both local development and continuous integration for quick validation, debugging, and automated report generation.

What is the best way to manage API test dependencies and caching in YAML?

The best way to manage API test dependencies and caching in YAML is by defining dependencies and relationships within the YAML test suite structure, allowing automatic generation of pytest cases with proper orchestration.