Metadata-Version: 2.5
Name: tracecov
Version: 0.26.2
Summary: Shows which parts of your OpenAPI spec your tests never exercise: operations, parameters, schema keywords, responses.
Project-URL: Homepage, https://tracecov.sh
Project-URL: Documentation, https://docs.tracecov.sh
Project-URL: Changelog, https://github.com/schemathesis/tracecov/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/schemathesis/tracecov/issues
Author-email: TraceCov Team <info@tracecov.sh>
License-Expression: LicenseRef-TraceCov-Community-1.0
License-File: LICENSE
Keywords: api,api-testing,coverage,json-schema,openapi,schema,schemathesis,swagger,testing
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: tracecov-community==0.26.2
Description-Content-Type: text/markdown

# TraceCov

**Shows which parts of your OpenAPI spec your tests never exercise: operations, parameters, schema keywords, responses.**

Your API tests pass. But did you actually test the validation rules?

Hitting `POST /users` with `{"name": "Alice", "age": 30}` gives you 100% endpoint coverage—but you haven't tested empty names, negative ages, or strings that are too long.

TraceCov measures coverage at the **schema keyword level**: `minLength`, `pattern`, `enum`, `minimum` - not just endpoints.

![API Coverage Report](https://docs.tracecov.sh/report-demo.png)

## Install

```bash
pip install tracecov
```

## Quick Start

Record two requests to the public Petstore API (needs `requests`):

```python
import requests
import tracecov

spec = requests.get("https://petstore3.swagger.io/api/v3/openapi.json").json()
coverage = tracecov.CoverageMap.from_dict(spec)
session = coverage.requests.track_session(requests.Session())

pet = {"id": 123456, "name": "fluffy", "photoUrls": [], "status": "available"}
session.post("https://petstore3.swagger.io/api/v3/pet", json=pet)
session.get("https://petstore3.swagger.io/api/v3/pet/123456")

coverage.save_report()  # writes coverage.html
```

Your test suite works the same way: send its requests through the tracked session.

## What It Tracks

| Dimension | What it measures |
|-----------|------------------|
| **Operations** | HTTP method + path combinations called |
| **Parameters** | Path, query, header, cookie, body coverage |
| **Keywords** | JSON Schema validation rules (`minLength`, `pattern`, etc.) |
| **Examples** | Schema examples and defaults used |
| **Responses** | HTTP status codes returned |

## Documentation

https://docs.tracecov.sh/

## Feedback

Questions and ideas: [GitHub Discussions](https://github.com/schemathesis/tracecov/discussions). Bugs: [GitHub Issues](https://github.com/schemathesis/tracecov/issues).

## Professional Edition

For advanced features, contact info@tracecov.sh.
