pytest-gen
Generate comprehensive pytest tests - use when generating tests, creating test suites, or testing Python code
소스 정보
- 저장소
- github/copilot-cli-for-beginners
- 최근 소스 활동
- 2026년 2월 19일 23:02
- 감지된 SKILL.md 언어
- 영어
- 스타
- 2,879
- 포크
- 2,578
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
SKILL.md 표시 중
SKILL.md
소스 지침 · 읽기 전용 미리보기- name
- pytest-gen
- description
- Generate comprehensive pytest tests - use when generating tests, creating test suites, or testing Python code
# Pytest Generation Skill
When generating tests, follow this structure.
## Test Organization
- Group tests by function under test
- Use `@pytest.mark.parametrize` for multiple inputs
- Use fixtures for shared setup
- Follow arrange/act/assert pattern
## Coverage Requirements
- Happy path (expected usage)
- Edge cases (empty strings, None, boundary values)
- Error cases (invalid input, file not found, wrong types)
- Integration (functions working together)
## Template
```python
import pytest
from module_under_test import function_to_test
@pytest.fixture
def sample_data():
"""Provide shared test data."""
return {"key": "value"}
class TestFunctionName:
"""Tests for function_name."""
def test_happy_path(self, sample_data):
result = function_to_test(valid_input)
assert result == expected_output
def test_empty_input(self):
result = function_to_test("")
assert result == expected_for_empty
@pytest.mark.parametrize("input_val,expected", [
("valid", True),
("", False),
(None, False),
])
def test_various_inputs(self, input_val, expected):
assert function_to_test(input_val) == expected
```
GitHub에서 보기