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 exampleT1-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 nameagentest, which is also the name of the plugin insideagentest-ai3.8.0, so pytest loaded only one of the two and the--agentest-otlp,--agentest-idsand--agentest-strictoptions could be missing. Both plugins now load together.
Links
- PyPI (agentest): https://pypi.org/project/agentest-ai/
- Plugin repo: https://github.com/srpadmanabhuni/pytest-agentest
- agentest repo: https://github.com/srpadmanabhuni/agentest
- Docs: https://srpadmanabhuni.github.io/agentest/
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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.