Skip to main content

pytest-agentest

pytest support for AiEnsured agentest, an Agentic AI Testing platform.

The pytest plugin ships inside agentest-ai 3.8.0 and later. Install agentest-ai and you have the agentest marker, the agentest_trace and agentest_record fixtures and assert_checks. This package depends on agentest-ai>=3.8, so installing it brings the plugin with it, and it keeps the command-line options and the agentest_run fixture from 0.1.0.

Install

pip install agentest-ai

Or, to keep the 0.1.0 options as well:

pip install pytest-agentest

Use the plugin that ships in agentest-ai

import pytest

@pytest.mark.agentest(trace="traces/refund.otlp.jsonl", card="agent-card.json", tools="tools.json", checks=["T1-005", "T1-018"])
def test_refund_run():
    pass

The full guide, with the fixtures and the recorder, is at https://github.com/srpadmanabhuni/agentest/blob/main/docs/integrations/pytest.md

What this package adds (from 0.1.0, unchanged)

Call agentest from a test with the agentest_run fixture:

def test_recorded_trace(agentest_run):
    result = agentest_run(otlp="traces/run.otlp.jsonl", ids="T1-018", fmt="md")
    assert result.returncode == 0

Or pass traces on the command line. With --agentest-strict, pytest fails if any check fails:

pytest --agentest-otlp traces/run.otlp.jsonl --agentest-ids T1-018 --agentest-strict
  • --agentest-otlp PATH: OTLP trace file (repeatable)
  • --agentest-ids IDS: limit to test IDs or classes, comma-separated (for example T1-018)
  • --agentest-strict: fail the pytest session if any agentest check fails

Changes in 0.2.0

  • Depends on agentest-ai>=3.8.
  • Registers its plugin under the entry-point name agentest_cli. In 0.1.0 it used the name agentest, which is also the name of the plugin inside agentest-ai 3.8.0, so pytest loaded only one of the two and the --agentest-otlp, --agentest-ids and --agentest-strict options could be missing. Both plugins now load together.

Metadata

Release files for pytest-agentest 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-agentest 0.2.0
File Size Uploaded Provenance Actions
pytest_agentest-0.2.0.tar.gz 8.8 kB With provenance Details for pytest_agentest-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-agentest 0.2.0
File Interpreter ABI Platform Actions
pytest_agentest-0.2.0-py3-none-any.whl Python 3 none any Details for pytest_agentest-0.2.0-py3-none-any.whl

Total release size: 17.4 kB

Release files / pytest_agentest-0.2.0.tar.gz

Download URL pytest_agentest-0.2.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b153e7ac7f71cc2abc2fdc62fb3ac6466724f862eadb0b45789f8f56b1a677ca
BLAKE2b-256 checksum
How to use checksums
be1a07182aa56153444f4c5590d239705e3e20254749b728f109ea0e31423dea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / pytest_agentest-0.2.0-py3-none-any.whl

Download URL pytest_agentest-0.2.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b92f517075f7d5a4fa6ded656e1ddeff107c1c46a2dfae9af6277e38c3a38ef6
BLAKE2b-256 checksum
How to use checksums
045e61f3454b94fac431bd8d2e2b7205b7389a82817b80fe3b5a2da4bb335539
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for pytest-agentest 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pytest_agentest-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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