Schemathesis is a property-based testing framework for API specifications, primarily OpenAPI and GraphQL. It generates test cases from your schema, fuzzing inputs to find edge cases and ensure API contracts are met. Currently at version 4.15.0, it maintains an active release schedule with frequent updates and improvements.
pip install schemathesisVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to load an OpenAPI schema from a URI and then execute property-based tests against a live API endpoint using `schemathesis.test()`. It includes notes on specifying the API base URL and handling authentication.
Migrate your test calls from `schema.validate_response(...)` to `result = schema.test(...)`. The `test()` method returns a `TestResult` object which provides success status and detailed reports.
Review the v4 migration guide for `from_asgi`/`from_wsgi` to update function calls. Ensure you're passing the application instance or the correct import path string as `app_or_path`.
Provide authentication credentials via the `headers`, `auth`, `app_url`, or `base_url` parameters when calling `schema.test()` or `schemathesis.from_uri()`. For complex scenarios, use Schemathesis hooks to inject authentication dynamically for each request.
Always explicitly provide the `base_url` argument to `schema.test()` to ensure tests target the correct API environment. For `schemathesis.from_uri()`, the `base_url` can also override or provide the API base URL if the schema doesn't define it or if it points to an incorrect environment.
No dependency data recorded yet.