test-generator

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

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "test-generator" with this command: npx skills add vstorm-co/pydantic-deepagents/vstorm-co-pydantic-deepagents-test-generator

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

  1. Edge Cases
  • Empty inputs (empty string, empty list, None)

  • Boundary values (0, -1, max int)

  • Single element collections

  1. Error Cases
  • Invalid types

  • Out of range values

  • Missing required parameters

  1. Integration Tests (if applicable)
  • Test interactions between components

  • Test with real dependencies where possible

Best Practices

  • One assertion per test when possible

  • Descriptive test names that explain what's being tested

  • Use fixtures for common setup

  • Use parametrize for testing multiple inputs

  • 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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Research

data-analysis

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-review

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

test-generator

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

test-generator

No summary provided by upstream source.

Repository SourceNeeds Review