搜索

PythonReactSEOPDF
GitHub Skill

testing

Automated test generation, review, and execution for pytest-based projects.

aiskillstore☆ 123 仓库 Stars6 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Testing Skill

Automated test generation, review, and execution for pytest-based projects.

Activation

Auto-activates on keywords: test, coverage, pytest, unittest, integration test, e2e, performance, benchmark, security testing

Workflows

Test Generation
  • generate.md: Generate test cases for code
Test Review
  • review.md: Review existing tests for quality
Specialized Testing
  • e2e.md: End-to-end testing patterns
  • security.md: Security testing patterns
  • performance.md: Performance testing patterns

Context Files

  • pytest-commands.md: Common pytest commands
  • pytest-patterns.md: Testing patterns and best practices

Commands

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=src/fragrance_rater --cov-report=html --cov-report=term-missing

# Run specific test categories
uv run pytest -m "not slow"
uv run pytest -m "integration"
uv run pytest -m "unit"

# Run with verbose output
uv run pytest -v --tb=short

# Run mutation testing
uv run mutmut run --paths-to-mutate=src/

# Run property-based tests
uv run pytest --hypothesis-show-statistics

Coverage Standards

  • Minimum Coverage: 80%
  • Branch Coverage: Enabled
  • Coverage Report: HTML and terminal output

Test Organization

tests/
├── unit/           # Unit tests (fast, isolated)
├── integration/    # Integration tests (may use external services)
├── e2e/           # End-to-end tests (full system)
├── security/      # Security-focused tests
├── performance/   # Performance and load tests
└── conftest.py    # Shared fixtures

Testing Patterns

AAA Pattern (Arrange-Act-Assert)
def test_example():
    # Arrange
    input_data = create_test_data()

    # Act
    result = function_under_test(input_data)

    # Assert
    assert result == expected_output
Fixtures
@pytest.fixture
def sample_data():
    return {"key": "value"}

def test_with_fixture(sample_data):
    assert sample_data["key"] == "value"

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-28
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!