Pytest test

From FortiumPartners/ai-mesh · View interactive version

Pytest test is an AI agent skill from the GitHub repository FortiumPartners/ai-mesh. Execute and generate pytest tests for Python projects with fixtures, parametrization, and mocking support

How to use this skill

Skill file

pytest Test Framework

Purpose

Provide pytest test execution and generation for Python projects, supporting:

Usage

Generate Test File

python generate-test.py \
  --source src/calculator.py \
  --output tests/test_calculator.py \
  --type unit \
  --description "Calculator fails to handle division by zero"

Execute Tests

python run-test.py \
  --file tests/test_calculator.py \
  --config pytest.ini

Output Format

Test Generation

{
  "success": true,
  "testFile": "tests/test_calculator.py",
  "testCount": 3,
  "template": "unit-test"
}

Test Execution

{
  "success": false,
  "passed": 2,
  "failed": 1,
  "total": 3,
  "duration": 0.234,
  "failures": [
    {
      "test": "test_divide_by_zero",
      "error": "AssertionError: Expected ZeroDivisionError",
      "file": "tests/test_calculator.py",
      "line": 15
    }
  ]
}

Integration

Used by deep-debugger for Python project testing:

  1. Invoke test-detector to identify pytest
  2. Invoke generate-test.py to create failing test
  3. Invoke run-test.py to validate test fails
  4. Re-run after fix to verify passing
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.