Skip to main content

Property-based testing framework for Open API and GraphQL based apps

Project description

Build Coverage Version Python versions Discord License

Schemathesis

Catch API bugs before your users do.

Schemathesis automatically generates thousands of test cases from your OpenAPI or GraphQL schema and finds edge cases that break your API.

Schemathesis automatically finding a server error
Finding bugs that manual testing missed

Try it now

# Test a demo API - finds real bugs instantly
uvx schemathesis run https://example.schemathesis.io/openapi.json

# Test your own API
uvx schemathesis run https://your-api.com/openapi.json

What problems does it solve?

  • 💥 500 errors that crash your API on edge case inputs
  • 📋 Schema violations where your API returns different data than documented
  • 🚪 Validation bypasses where invalid data gets accepted
  • 🔗 Integration failures when responses don't match client expectations

⚠️ Upgrading from older versions? Check our Migration Guide for key changes.

Installation & Usage

Command Line:

uv pip install schemathesis
schemathesis run https://your-api.com/openapi.json

Python Tests:

import schemathesis

schema = schemathesis.openapi.from_url("https://your-api.com/openapi.json")

@schema.parametrize()
def test_api(case):
    case.call_and_validate()  # Finds bugs automatically

CI/CD:

- uses: schemathesis/action@v2
  with:
    schema: "https://your-api.com/openapi.json"

Who uses it

Used by teams at Spotify, WordPress, JetBrains, Red Hat and dozens other companies.

"Schemathesis is the best tool for fuzz testing of REST API on the market. We are at Red Hat use it for examining our applications in functional and integrations testing levels." - Dmitry Misharov, RedHat

Documentation

📚 Complete documentation with guides, examples, and API reference.

Get Help

Contributing

We welcome contributions! See our contributing guidelines and join discussions in issues or Discord.

Acknowledgements

Schemathesis is built on top of Hypothesis, a powerful property-based testing library for Python.

License

This project is licensed under the terms of the MIT license.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

schemathesis-4.0.9.tar.gz (57.7 MB view details)

Uploaded Source

Built Distribution

schemathesis-4.0.9-py3-none-any.whl (305.9 kB view details)

Uploaded Python 3

File details

Details for the file schemathesis-4.0.9.tar.gz.

File metadata

  • Download URL: schemathesis-4.0.9.tar.gz
  • Upload date:
  • Size: 57.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for schemathesis-4.0.9.tar.gz
Algorithm Hash digest
SHA256 47ab1a791413f4731a8953f44d6968a519d1137d37739f47d7b587af3b4ef1be
MD5 ded04f06ff675e51ec2209a542b281d7
BLAKE2b-256 75f5136a45a087a76818f3ef725d3dcf7d26ab2ecc3de6a31c8a642035ab2110

See more details on using hashes here.

File details

Details for the file schemathesis-4.0.9-py3-none-any.whl.

File metadata

  • Download URL: schemathesis-4.0.9-py3-none-any.whl
  • Upload date:
  • Size: 305.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for schemathesis-4.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 655b01aa276e4c4389e2983af0657bd2ac09a68c1fd900edc917376c65d12c40
MD5 a49cb0e8301ec78595220a57e2009950
BLAKE2b-256 2207c3275d20ac0106ad397d100778ce11dae74ccb4e36e1f21a75c439650565

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page