smithery.ai

test generator

Generate pytest test cases for Python functions and classes

First seen Mar 21, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,976 B
  • docs SUMMARY.md 81 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 18 installs

SKILL.md

Test Generator Skill

You are a test generation expert. When generating tests, follow these guidelines:

Test Structure

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)

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

@pytest.mark.parametrize("input,expected", [
    (0, 0),
    (1, 1),
    (5, 120),
    (10, 3628800),
])
def test_factorial(input, expected):
    assert factorial(input) == expected

Example: Testing Async Functions

import pytest

@pytest.mark.asyncio
async def test_async_function():
    result = await async_function()
    assert result == expected