skilltest-pytest
A pytest plugin for skilltest: run
AI-skill tests and natural-language evals as ordinary pytest tests, and mix in
your own deterministic checks. Built on
skilltest-sdk — the SDK's code API is
re-exported here, so a pytest suite needs only this one dependency.
Two ways to use it
Auto-collected case files. Name a case something.skilltest.yaml and pytest
runs it:
# greet.skilltest.yaml
skill: ./skills/greeter
input: "Greet Dr. Smith."
evals:
- type: boolean
criterion: "the reply greets Dr. Smith by name"
As code, for matrices and deterministic mix-ins:
from skilltest_pytest import run_skill, describe_failures, assistant_text
def test_greeter():
report = run_skill("cases/greet.yaml", platforms=["claude-code"], models=["claude-opus-4-8"])
assert report.passed, describe_failures(report)
assert "Dr. Smith" in assistant_text(report.runs[0].transcript)
Assert on tool use, and stream
The SDK's tool-event and streaming surfaces are re-exported too. tool_calls
returns the normalized tool_call events a run took (each a ToolEvent with
kind/name/input/output/index), and stream_skill yields them live so a
test can short-circuit on bad behavior:
from skilltest_pytest import run_skill, tool_calls
def test_commits_but_never_deletes():
report = run_skill("cases/edit.skilltest.yaml")
calls = tool_calls(report.runs[0].transcript)
assert any("git commit" in str(c.input) for c in calls)
assert not any("rm -rf" in str(c.input) for c in calls)
import asyncio
from skilltest_pytest import stream_skill
def test_makes_no_network_call():
async def go():
async for ev in stream_skill("cases/edit.skilltest.yaml"):
assert ev.event.name != "curl", "skill made a network call"
asyncio.run(go()) # or use pytest-asyncio and `async def test_...`
Configuration
The plugin shells out to the skilltest binary. Point it at one with the
SKILLTEST_BIN env var (or bin=), the provider with SKILLTEST_PROVIDER (or
provider=), and set defaults in pyproject.toml:
[tool.pytest.ini_options]
skilltest_provider = "oneharness"
skilltest_platforms = ["claude-code"]
skilltest_models = ["claude-opus-4-8"]
See the repository root for the provider protocol and the full schema.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skilltest_pytest-0.5.0.tar.gz.
File metadata
- Download URL: skilltest_pytest-0.5.0.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4e8ad705fb18e55487c1267de45cb0d2277f17141136091f104d02f9fa3a131
|
|
| MD5 |
0c732edd9a5a5ba658fffe7458946006
|
|
| BLAKE2b-256 |
107461d6f686364fd4d1fe8cacbe3e1fa83fb118e636565a5ed5ec61f976f3a6
|
File details
Details for the file skilltest_pytest-0.5.0-py3-none-any.whl.
File metadata
- Download URL: skilltest_pytest-0.5.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3619f68b357e7e18b8ae2c0d03eb2b4d654cbb725ed7ccdec709d94dfdd32459
|
|
| MD5 |
029901031279a1c64bbbaab5ee74ba0a
|
|
| BLAKE2b-256 |
32084590ebd2c860dd300c9eafad5458277ee25f14da8aaa345dd6cbb678dae3
|