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.
Define the whole case in code (recommended)
Build the case — skill, input, evals, an optional simulated user, mocks — right in the test. Everything the YAML carries has a typed builder, so the case, its mocks, and any deterministic transcript checks live in one place:
from skilltest_pytest import TestCase, run_skill, boolean, numeric, describe_failures
def test_greeter():
case = TestCase(
skill="skills/greeter", # resolved relative to the working dir
input="Greet Dr. Smith, who has an appointment today.",
evals=[
boolean("the reply greets Dr. Smith by name"),
numeric("how warm is the tone", min=0, max=10, threshold=7),
],
)
report = run_skill(case, platforms=["claude-code"], models=["claude-opus-4-8"])
assert report.passed, describe_failures(report)
Multi-turn cases add user(...); deterministic call-count checks use called /
not_called taking the stub/spy object itself or a name you gave it (or
use the mock objects' own assertions — see below). run_skill also takes platforms=/models= to fan a
case across a matrix.
Or point at a YAML file
run_skill accepts a path just as well (run_skill("cases/greet.yaml")), and
auto-collection still works: name a case something.skilltest.yaml and
pytest runs it with no test function at all —
# greet.skilltest.yaml
skill: ./skills/greeter
input: "Greet Dr. Smith."
evals:
- type: boolean
criterion: "the reply greets Dr. Smith by name"
The full field reference for both forms is docs/schema.md.
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 TestCase, run_skill, tool_calls, boolean
EDIT_CASE = TestCase(
skill="skills/editor",
input="Update the config and commit it.",
evals=[boolean("the change was committed")],
)
def test_commits_but_never_deletes():
report = run_skill(EDIT_CASE)
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(EDIT_CASE):
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.
Metadata
Release files for skilltest-pytest 0.13.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 |
|---|---|---|---|---|
| skilltest_pytest-0.13.0.tar.gz | 13.9 kB | Without provenance | Details for skilltest_pytest-0.13.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| skilltest_pytest-0.13.0-py3-none-any.whl | Python 3 | none | any | Details for skilltest_pytest-0.13.0-py3-none-any.whl |
Total release size: 19.6 kB
Release files / skilltest_pytest-0.13.0.tar.gz
| Download URL | skilltest_pytest-0.13.0.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e481dae4585e33dee1c482ece494543934643e09a046ccf76a98a3b7ccf15222
|
|
BLAKE2b-256 checksum How to use checksums |
b1a16429be85858e98c47d7ddf306294ab46614e4cbb7fe2fe282f8f01c9a224
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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}
|
Release files / skilltest_pytest-0.13.0-py3-none-any.whl
| Download URL | skilltest_pytest-0.13.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f628dedd983ba0141d96b0fcf294fe22296fb57e35eb4519efc7f9803d2f8e40
|
|
BLAKE2b-256 checksum How to use checksums |
c2dd738a4b541d6703959473783650f7aa64ebece8ca1a2692555f2fa2eac0b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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}
|
Security for skilltest-pytest 0.13.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.