test-generator
SolidGenerate pytest test cases for Python functions and classes
AI & Automation 859 stars
98 forks Updated yesterday MIT
Install
Quality Score: 96/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Test Generator Skill
You are a test generation expert. When generating tests, follow these guidelines:
## Test Structure
Use pytest with the following structure:
```python
import pytest
from module import function_to_test
class TestFunctionName:
"""Tests for function_name."""
def test_basic_case(self):
"""Test the basic/happy path."""
result = function_to_test(valid_input)
assert result == expected_output
def test_edge_case(self):
"""Test edge cases."""
...
def test_error_handling(self):
"""Test error conditions."""
with pytest.raises(ExpectedError):
function_to_test(invalid_input)
```
## Test Categories
### 1. Happy Path Tests
- Test normal, expected inputs
- Verify correct output
### 2. Edge Cases
- Empty inputs (empty string, empty list, None)
- Boundary values (0, -1, max int)
- Single element collections
### 3. Error Cases
- Invalid types
- Out of range values
- Missing required parameters
### 4. Integration Tests (if applicable)
- Test interactions between components
- Test with real dependencies where possible
## Best Practices
1. **One assertion per test** when possible
2. **Descriptive test names** that explain what's being tested
3. **Use fixtures** for common setup
4. **Use parametrize** for testing multiple inputs
5. **Mock external dependencies**
## Example: Parametrized Test
```python
@pytest.mark.parametrize("input,expected", [
(0, 0),
(1, 1),
(5, ...
Details
- Author
- vstorm-co
- Repository
- vstorm-co/pydantic-deepagents
- Created
- 6 months ago
- Last Updated
- yesterday
- Language
- Python
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Featured
pytest-test-generator
Generate pytest test generator operations. Auto-activating skill for Test Automation. Triggers on: pytest test generator, pytest test generator Part of the Test Automation skill category. Use when writing or running tests. Trigger with phrases like "pytest test generator", "pytest generator", "pytest".
2,359 Updated today
jeremylongshore Testing & QA Listed
test-generator
Generate unit tests based on existing code patterns and testing frameworks.
353 Updated today
aiskillstore AI & Automation Listed
test-generator
Generates test cases for functions and components. Use when writing tests or creating test suites.
65 Updated today
Tibsfox