Skip to main content

pytest-agents

CI CodeQL Release GitHub Release PyPI Security Policy Python Version Coverage Tests Metrics License Docker Code Style

A pytest plugin framework with AI agent capabilities for project management, research, and code indexing.

Quick Start

# Install from PyPI
pip install pytest-agents

# Verify installation
pytest-agents verify

Features

  • Pytest Plugin: Extended pytest with custom markers and AI agent integration
  • PM Agent: TypeScript-based project management agent for task tracking and planning
  • Research Agent: AI-powered research and documentation analysis
  • Index Agent: Code indexing and intelligent search capabilities
  • Prometheus Metrics: Comprehensive observability with metrics collection and HTTP endpoint
  • Dependency Injection: Full DI implementation across Python and TypeScript components
  • Skills System: Extensible runtime skills for specialized tasks

Getting Started

Installation

From PyPI (Recommended):

pip install pytest-agents

From Docker:

docker pull ghcr.io/lanier-developments/pytest-agents:latest
docker run ghcr.io/lanier-developments/pytest-agents:latest pytest-agents verify

From Source:

# Clone repository
git clone https://github.com/Lanier-Developments/pytest-agents.git
cd pytest-agents

# Install with uv
make install

# Or manually
uv pip install -e ".[dev]"

Verify Installation

make verify

Run Tests

# All tests
make test

# Python only
make test-python

# TypeScript only
make test-ts

Project Structure

pytest-agents/
├── src/pytest_agents/   # Python pytest plugin package
├── tests/               # Python tests
├── pm/                  # TypeScript PM agent
├── research/            # TypeScript Research agent
├── index/               # TypeScript Index agent
├── skills/              # Runtime skills
├── commands/            # Command documentation
└── docs/                # Documentation

Usage

Using Custom Pytest Markers

import pytest

@pytest.mark.unit
def test_basic_functionality():
    assert True

@pytest.mark.integration
@pytest.mark.agent_pm
def test_with_pm_agent(pytest_agents_agent):
    result = pytest_agents_agent.invoke('pm', 'analyze_project')
    assert result['status'] == 'success'

Parallel Agent Execution

Run multiple agents concurrently for faster test execution:

def test_multi_agent_parallel(agent_coordinator):
    """Run multiple agents in parallel."""
    results = agent_coordinator.run_parallel([
        ('pm', 'track_tasks', {'path': './src'}),
        ('research', 'analyze_document', {'path': 'README.md'}),
        ('index', 'index_repository', {'path': './src'})
    ])

    assert all(r['status'] == 'success' for r in results)

Invoking Agents

# Via Python API
from pytest_agents.agent_bridge import AgentBridge

bridge = AgentBridge()
result = bridge.invoke_agent('pm', 'track_tasks', {'path': './src'})
# Via CLI
pytest-agents agent pm --action track_tasks --path ./src

Metrics and Observability

# Start Prometheus metrics server
pytest-agents metrics

# Custom port
pytest-agents metrics --port 8080

# Configure via environment
export PYTEST_AGENTS_METRICS_ENABLED=true
export PYTEST_AGENTS_METRICS_PORT=9090

View metrics at http://localhost:9090/metrics. See Metrics Documentation for Prometheus and Grafana integration.

Development

Code Quality

# Format code
make format

# Lint code
make lint

Health Check

make doctor

Docker Support

pytest-agents is fully containerized for easy deployment and development.

Quick Start with Docker

# Build and run verification
docker-compose up pytest-agents

# Run tests in Docker
docker-compose --profile test up pytest-agents-test

# Start development shell
docker-compose --profile dev run pytest-agents-dev

See Docker Documentation for complete deployment guide.

Security

pytest-agents implements enterprise-grade security practices:

Automated Security Scanning

  • CodeQL: Static analysis detecting 400+ security vulnerabilities in Python and TypeScript
  • Snyk Security: Continuous vulnerability scanning for dependencies and containers
  • Dependency Scanning: Automated vulnerability detection via Dependabot
  • Container Scanning: Docker image vulnerability assessment
  • Code Quality: Ruff linting with security-focused rules

Security Features

  • Multi-stage Docker builds with minimal attack surface
  • Dependency pinning for reproducible builds
  • Comprehensive automated test suite with coverage enforced in CI
  • Automated security updates grouped by severity

Setup and Configuration

New to security scanning? See Security Setup Guide for step-by-step instructions to activate Snyk and Dependabot.

Reporting Vulnerabilities

Please report security vulnerabilities privately via GitHub Security Advisories.

See SECURITY.md for complete security policy and disclosure guidelines.

Documentation

See docs/ directory for detailed documentation:

License

MIT

Author

Kevin McAllorum

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_agents-1.1.8.tar.gz (325.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_agents-1.1.8-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file pytest_agents-1.1.8.tar.gz.

File metadata

  • Download URL: pytest_agents-1.1.8.tar.gz
  • Upload date:
  • Size: 325.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pytest_agents-1.1.8.tar.gz
Algorithm Hash digest
SHA256 d74190ac30c9c5a824a761bb3101c15d5fbf50cde1e258f6333308b6fa3d7d88
MD5 4d1619d6dbac1fead2ebae6c38123d3f
BLAKE2b-256 25a1b80f2f2101d3d20714ed001b922bac8c7894bed5109cd2e97c4c8b50e80a

See more details on using hashes here.

File details

Details for the file pytest_agents-1.1.8-py3-none-any.whl.

File metadata

  • Download URL: pytest_agents-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pytest_agents-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 705e1c5a10a9fdc1b79b7d3776f55a38035a379df14c35a4705fd1ebe9dcafc4
MD5 9d70e812d1e88d7a43d81544df7175b8
BLAKE2b-256 259954c493bf52c32c9dee6a7d5ba8df0b3642de7ed59108db945b57ee44eaef

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.8 This release

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.20

2 files

1.0.19

2 files

1.0.18

2 files

1.0.17

2 files

1.0.16

2 files

1.0.15

2 files

1.0.14

2 files

1.0.13

2 files

1.0.12

2 files

1.0.11

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.2

2 files

0.8.4

2 files

0.8.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page