test-generation

Generate unit tests, integration tests, and test fixtures for code

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-generation" with this command: npx skills add tatat/agents-playground/tatat-agents-playground-test-generation

Test Generation

Generate comprehensive tests for code.

Capabilities

  • Generate unit tests for functions and classes
  • Create integration tests for APIs and services
  • Build test fixtures and mocks
  • Cover edge cases and error conditions

Test Structure

import pytest

class TestClassName:
    """Tests for ClassName."""

    def test_method_success(self):
        """Test method with valid input."""
        result = function_under_test(valid_input)
        assert result == expected_output

    def test_method_edge_case(self):
        """Test method with edge case."""
        result = function_under_test(edge_case_input)
        assert result == edge_case_output

    def test_method_error(self):
        """Test method raises error on invalid input."""
        with pytest.raises(ValueError):
            function_under_test(invalid_input)

Coverage Targets

TypeTarget
Unit tests80%+ line coverage
Branch coverage70%+
Critical paths100%

Test Categories

  1. Happy path - Normal expected usage
  2. Edge cases - Boundary values, empty inputs
  3. Error cases - Invalid inputs, exceptions
  4. Integration - Component interactions

Fixtures Example

@pytest.fixture
def sample_user():
    return User(name="Test User", email="test@example.com")

@pytest.fixture
def mock_database(mocker):
    return mocker.patch("app.db.connection")

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.

Coding

code-review

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

fitness-coach

No summary provided by upstream source.

Repository SourceNeeds Review
128-tatat
Automation

document-summary

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

creative-writer

No summary provided by upstream source.

Repository SourceNeeds Review