$npx skillfedfor your agent

pytest-schema

👍 Validate return values against a schema-like object in testing

With conditionsPyPI TestingReleased Feb 2024113.4K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytest_schema-0.1.2-py3-none-any.whl
v0.1.2 · released 2024-02-16 · Python !=2.7.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* · 2 runtime deps: pytest, schema

Yes, if you need lightweight schema validation in pytest tests and don't require active maintenance. The package is stable and low-friction to install, but its dormant status (910 days since last release) means it won't receive updates for new pytest or Python versions. Use it for straightforward response validation; consider alternatives if you need ongoing support or complex JSON Schema features.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction install with only two runtime dependencies (pytest and schema).
  • Dormant maintenance status—last release was 910 days ago with no recent commits, though the repository is not archived and the package is marked Production/Stable.

License · maintenance · safety

MIT (permissive) — MIT license permits use in proprietary and open-source projects with minimal restriction; you must include a copy of the license and copyright notice.

last release 2024-02-16 (910 days) · last repo commit 2024-02-16 · 9 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 113,396 downloads/mo, #12,342 on PyPI

Verify before relying

pip install pytest-schema

from pytest_schema import schema

article_schema = {"id": int, "title": str, "completed": bool}

def test_endpoint(test_client):
    response = test_client.get("/api/article/1")
    assert schema(article_schema) == response
  • Whether the schema library's validation rules and error messages are sufficient for your test reporting needs.
  • Current compatibility with modern pytest versions and whether dormant status affects future pytest updates.
Same gist for agents: .md · .json

What it is and what it does

pytest-schema is a pytest plugin that wraps the schema library to validate Python data structures—typically API responses, config objects, or parsed JSON—against declarative schema definitions in test assertions. It provides functions like schema(), exact_schema(), and like_schema() that compare actual data against a template defining expected types, nested structures, optional fields, and custom validation rules (regex, enums, lambdas). When data matches the schema, the assertion passes; when it doesn't, a SchemaError is raised with details about the mismatch.

The package is designed for testing REST endpoints, webhooks, or any code that returns structured data. You define a schema once—a plain Python dict with types and validators—then reuse it across multiple tests. It handles optional fields, nested objects, lists, and custom predicates, making it useful for regression testing API contracts or validating config file parsing without writing repetitive type checks.

Use it for

  • Validate JSON responses from REST API endpoints match expected structure and types in integration tests.
  • Test that config file parsing produces the correct nested dict/list structure with proper type conversions.
  • Ensure backwards compatibility by checking that new API versions still satisfy older schema constraints.
  • Validate webhook payloads or event data conform to a contract before processing in business logic.
  • Check that data transformations (e.g., ORM queries, ETL pipelines) produce correctly typed and shaped output.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need lightweight schema validation in pytest tests and don't require active maintenance.

The package is stable and low-friction to install, but its dormant status (910 days since last release) means it won't receive updates for new pytest or Python versions. Use it for straightforward response validation; consider alternatives if you need ongoing support or complex JSON Schema features.

Install

pytest-schema on PyPI

Before you install

Low friction install with only two runtime dependencies (pytest and schema). Dormant maintenance status—last release was 910 days ago with no recent commits, though the repository is not archived and the package is marked Production/Stable.

License in practice

MIT license permits use in proprietary and open-source projects with minimal restriction; you must include a copy of the license and copyright notice.

Quickstart

pip install pytest-schema

from pytest_schema import schema

article_schema = {"id": int, "title": str, "completed": bool}

def test_endpoint(test_client):
    response = test_client.get("/api/article/1")
    assert schema(article_schema) == response

Verify before relying

  • Whether the schema library's validation rules and error messages are sufficient for your test reporting needs.
  • Current compatibility with modern pytest versions and whether dormant status affects future pytest updates.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release !=2.7.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
pytestschema
MaintenanceDormant 910 days since the last release
Last repo commit
First released
Downloads113,396 / month, #12,342 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Testing

Evidence: pytest_schema-0.1.2-py3-none-any.whl

Tags

Capabilities
pytest response validationschema validation testingapi response schema checkdata structure validation pytestjson schema testingtype checking test assertionsendpoint response validation
Topics
api-testingschema-validation

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pytest response validation”

  • pytest-schemaValidates function return values and API responses against schema…
  • tavernTavern is a pytest plugin and command-line tool for automated testing…
  • pytest-checkA pytest plugin that allows tests to continue running and collect…

Give your agent the search over MCP, or paste the wish link into any chat.

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.

Install it if you write tests for any asyncio-based code.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.

Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also schema · pytest-responses · yamale · pandas-schema · pytest-unordered · django-pydantic-field · fastjsonschema · check-jsonschema · magicattr · json-schema-to-pydantic