Metadata-Version: 2.4
Name: pytest-agent-saga
Version: 0.4.0
Summary: Pytest plugin for agent-saga: deterministic replay verification, chaos injection, and WAL fixtures.
Project-URL: Homepage, https://github.com/thomasjgeorge23/agent-saga
Project-URL: Repository, https://github.com/thomasjgeorge23/agent-saga
Author-email: AgentSaga Team <dev@agent-saga.io>
License-Expression: MIT
Keywords: agent-saga,ai-agents,chaos-engineering,pytest,saga,testing
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.9
Requires-Dist: agent-saga>=0.2.3
Requires-Dist: pytest>=7.0.0
Description-Content-Type: text/markdown

# pytest-agent-saga

Official Pytest plugin for **agent-saga** — bringing deterministic replay verification, chaos injection testing, and WAL assertions to your AI agent test suite.

## Installation

```bash
pip install pytest-agent-saga
```

## Features & Fixtures

- `saga_wal`: Isolated temporary file WAL fixture per test.
- `chaos_runner`: Inject synthetic failures at step boundaries or run mutation testing over compensation handlers.
- `assert_saga_deterministic`: Verify that a saga's forward and compensation execution matches deterministically across test runs.

## Example

```python
import pytest

async def test_order_saga(saga_wal, chaos_runner):
    # Run saga under chaos injection
    result = await chaos_runner.run(my_order_saga, fail_point=2)
    assert result.rolled_back is True
    assert "refund_payment" in result.compensations_executed
```
