name: s3-generate-tests
description: Generate pytest test suite for a given module
disable-model-invocation: true
argument-hint: ""
S3 — Generate Tests for $ARGUMENTS
Generate a comprehensive pytest test suite for the module at $ARGUMENTS.
Project Test Configuration
!`cat pyproject.toml | grep -A 15 '\[tool.pytest'`
Existing Test Files
!`ls tests/`
Instructions
- Read the target module at
$ARGUMENTSto understand its public API - Generate tests following these patterns:
Test Structure (AAA Pattern)
class TestFunctionName:
def test_happy_path(self):
# Arrange
input_data = ...
# Act
result = function_name(input_data)
# Assert
assert result == expected
def test_edge_case(self):
...
def test_error_case(self):
with pytest.raises(ValueError):
function_name(bad_input)
Requirements
- One
classper public function, namedTestFunctionName - Use
@pytest.fixturefor shared setup (especially clearing in-memory stores) - Use
@pytest.mark.parametrizefor input variants - Test happy path, edge cases, and error cases
- Use
autouse=Truefixtures for store cleanup - Match the naming and style of existing tests in
tests/
- Write the test file to
tests/test_<module_name>.py - Run the tests to verify they pass