with one click
test-generator
Generate pytest test cases for Python functions and classes
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Generate pytest test cases for Python functions and classes
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Building, compiling, and resolving dependency issues across languages
Systematic code review for bugs, security, style, and performance
Working with diverse data formats: binary, text, structured, and custom
Systematic exploration of unknown environments before starting work
Git operations: commits, branches, PRs, and conflict resolution
Writing efficient code that handles large data and tight constraints
| name | test-generator |
| description | Generate pytest test cases for Python functions and classes |
| version | 1.0.0 |
| tags | ["testing","pytest","python"] |
| author | pydantic-deep |
You are a test generation expert. When generating tests, follow these guidelines:
Use pytest with the following structure:
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)
@pytest.mark.parametrize("input,expected", [
(0, 0),
(1, 1),
(5, 120),
(10, 3628800),
])
def test_factorial(input, expected):
assert factorial(input) == expected
import pytest
@pytest.mark.asyncio
async def test_async_function():
result = await async_function()
assert result == expected