🦀 ClawHub
test-fixture-generator
by @shenghoo123-png
Automatically generate pytest fixtures for databases, API mocks, and file handling with setup and teardown support.
TERMINAL
clawhub install test-fixture-generator📖 About This Skill
test-fixture-generator
名称
test-fixture-generator描述
自动生成pytest fixtures的工具,支持常见测试场景(数据库、API mock、文件处理等)触发词
fixture, pytest fixture, conftest, 测试夹具指令
生成pytest fixtures代码使用方式
# 生成数据库fixture
python -m test_fixture_generator generate --type db --db-type mysql生成API mock fixture
python -m test_fixture_generator generate --type api --framework requests生成文件处理fixture
python -m test_fixture_generator generate --type file --format json生成conftest.py
python -m test_fixture_generator init交互式生成
python -m test_fixture_generator interactive
参数说明
--type: fixture类型 (db|api|file|random)--db-type: 数据库类型 (mysql|postgres|sqlite)--framework: mock框架 (requests|httpx|boto3)--format: 文件格式 (json|yaml|csv|toml)--output: 输出文件路径