Metadata-Version: 2.4
Name: pytest-probatio
Version: 0.3.0
Summary: Use a probatio schema as a pytest assertion matcher
Project-URL: Homepage, https://github.com/frenck/probatio
Project-URL: Repository, https://github.com/frenck/probatio
Project-URL: Issues, https://github.com/frenck/probatio/issues
Author-email: Franck Nijhof <opensource@frenck.dev>
Maintainer-email: Franck Nijhof <opensource@frenck.dev>
License-Expression: MIT
License-File: LICENSE
Keywords: probatio,pytest,schema,testing,validation
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Testing
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: probatio>=0.1.0
Requires-Dist: pytest>=8
Description-Content-Type: text/markdown

# pytest-probatio

Use a [probatio](https://github.com/frenck/probatio) schema as a pytest assertion
matcher. A schema reads as the expected shape, and a mismatch is explained by
probatio's path-precise errors instead of a bare `assert`.

```python
from pytest_probatio import Exact, Partial
from probatio import Port


def test_response(response):
    # Exact: extra keys make it unequal.
    assert response == Exact({"name": str, "port": Port()})

    # Partial: extra keys are allowed.
    assert response == Partial({"name": str})
    assert Exact({"name": str}) <= response
```

When the data does not match, the failure lists each error by its path:

```
data does not match the probatio schema (==):
  data['port']: expected a port number between 1 and 65535
```

Install it alongside pytest; the plugin registers itself:

```bash
pip install pytest-probatio
```

This package lives in the probatio monorepo but ships separately, so the core
`probatio` library stays dependency-free.
