Skip to main content

pytest-skill-engineering

PyPI version CI License: MIT

A test runner for people working with coding agents.

Test whether real GitHub Copilot sessions can use your MCP servers, CLI tools, skills, system prompts, and custom agents. Write a user task, execute it through pytest, and verify the actual output with ordinary assertions.

The framework runs the task and records what happened. Your existing coding agent investigates the evidence, reads the source, and helps you improve the interface. Version 1.0 removes AI judging, report dashboards, rankings, and skill refinement. See the migration guide for this breaking change.

Why this exists

Your tool can pass its own tests while Copilot chooses the wrong operation, supplies the wrong arguments, or misunderstands its descriptions. That is a different question from whether the tool implementation works.

Use real task execution to test the AI-facing interface, and independent output checks to establish correctness. A completed session or a tool call by itself does not prove that the requested task succeeded.

Quick start

You need Python 3.11+, uv, and a GitHub account with Copilot access.

uv add pytest-skill-engineering
gh auth login --hostname github.com
uv run pytest-skill-engineering init
uv run pytest-skill-engineering doctor
uv run python -m pytest "tests\test_copilot_eval.py" -v

init creates a Todo MCP starter test, explicit JSON evidence settings, and explicit starter-model rates in pricing.toml. It refuses conflicting settings or an existing starter. Live execution can consume Copilot premium requests.

pytest shows ordinary test results and assertion failures. Give your coding agent aitest-reports\results.json and the relevant source to investigate what happened. No dashboard or second AI judgment is generated.

What we learned by testing our own idea

We evaluated a companion skill for coding agents using this framework and chose not to ship it. The comparison did not demonstrate a benefit; adding general test-writing advice was not evidence that users needed another product layer. Use the documentation, examples, and native evidence directly.

The case study records the actual results, failures, limitations, and removal decision. Its historical experiment remains reproducible with a frozen test fixture, not an installable companion skill. Default sample checks are offline; live execution is explicit. The quickstart is the smaller first example.

Testing your own domain skills remains a supported framework capability.

A test that checks the result

from __future__ import annotations

import subprocess
import sys

from pytest_skill_engineering.copilot import CopilotEval


async def test_addition(copilot_eval, tmp_path):
    agent = CopilotEval(
        name="addition",
        model="gpt-5.6-luna",
        instructions="Write Python code and save the requested file.",
        working_directory=str(tmp_path),
    )
    result = await copilot_eval(agent, "Create calc.py with add(a, b) returning a + b.")
    assert result.success, result.error
    assert (tmp_path / "calc.py").is_file()
    checked = subprocess.run(
        [
            sys.executable,
            "-c",
            "from calc import add; assert add(2, 3) == 5; assert add(-2, 2) == 0",
        ],
        cwd=tmp_path,
        capture_output=True,
        text=True,
        timeout=10,
    )
    assert checked.returncode == 0, checked.stderr

Use your approved isolation when executing generated code. A temporary directory is not a security sandbox.

What stays in the framework

Capability What it provides
CopilotEval and copilot_eval Real SDK sessions with explicit configuration
MCP, CLI, skills, plugins, custom agents The interfaces and definitions under test
Execution controls Time, usage, request, tool, and permission controls; one attempt per execution
Captured evidence Configuration, calls, arguments, outputs, completion flags, errors, and usage
Ordinary pytest checks Consumer-owned verification and recorded properties
ab_run and repetitions Isolated working directories and repeated observations
Structured JSON Captured execution and ordinary pytest outcomes, without rankings or advice
Pricing Explicit USD estimates and recorded Copilot premium requests

A/B entries share one pytest outcome. Record side-specific checks; do not read that shared outcome as independent per-side success or causal improvement. Missing prices and incomplete evidence are recorded explicitly.

Let your coding agent investigate

Ask your existing coding agent to inspect a failed test, its saved JSON evidence, and the source. It can explain the supported cause and help fix it, without changing the test's success criteria after seeing the failure.

Reading current schema-4.0 evidence needs no authentication or paid call. The framework records results; the coding agent interprets them. Subjective review is advice, not an automatic pytest verdict.

Read the full documentation.

License

MIT. Inspired by agent-benchmark.

Metadata

Release files for pytest-skill-engineering 1.0.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-skill-engineering 1.0.0
File Size Uploaded
pytest_skill_engineering-1.0.0.tar.gz 89.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-skill-engineering 1.0.0
File Interpreter ABI Platform
pytest_skill_engineering-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 201.4 kB

Release files / pytest_skill_engineering-1.0.0.tar.gz

Download URL pytest_skill_engineering-1.0.0.tar.gz
Size 89.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4731625084eff4e597cfc037485f3d4ce5b22d66add2d2a24513f83236d18c89
BLAKE2b-256 checksum
How to use checksums
1c64564835711ab5052cd2ebf0952ee09393bfca04e42593ab06f98b927e6cec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

Release files / pytest_skill_engineering-1.0.0-py3-none-any.whl

Download URL pytest_skill_engineering-1.0.0-py3-none-any.whl
Size 112.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
105d7943d73c57699be6f7889d6f922acd8eb795b75486ca7acf317c04e3ef81
BLAKE2b-256 checksum
How to use checksums
e0a1bb468eab4e86481e56133a69dfafe9866b66298044846bccd22b42cccbcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

0.6.23

2 release files

0.6.22

2 release files

0.6.21

2 release files

0.6.20

2 release files

0.6.18

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

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