os-python-schemathesis
Packaging for python-schemathesis
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 1 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, acm.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.1%) to scientific vocabulary
Repository
Packaging for python-schemathesis
Basic Info
- Host: GitHub
- Owner: pexip
- License: mit
- Language: Python
- Default Branch: bookworm
- Size: 55.2 MB
Statistics
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
- Releases: 0
Metadata Files
README.md
Discover API-breaking payloads, keep API documentation up-to-date, and increase confidence in your API
Documentation: https://schemathesis.readthedocs.io/en/stable/
Chat: https://discord.gg/R9ASRAmHnA
Schemathesis is a specification-based testing tool for OpenAPI and GraphQL apps based on the powerful Hypothesis framework.
Here are the key features:
- OpenAPI & GraphQL: Test a wide range of APIs with ease, regardless of the specification used.
- Positive & Negative Tests: Ensure your API handles valid and invalid inputs, incl. unexpected ones.
- Stateful Testing: Automatically generate sequences of API requests where subsequent requests build on previous ones for testing complex and interdependent scenarios.
- Session Replay: Quickly store and replay test sessions to easily investigate and resolve issues.
- Targeted Testing: Guide data generation towards specific metrics like response time or size. Uncover performance or resource usage issues and optimize API behavior under different conditions.
- Python Integration: Utilize native ASGI/WSGI support for faster testing your Python applications.
- Customization: Tune data generation, API response verification, and testing process to fit your needs.
- CI Integration: Run tests on every code change with Docker image and GitHub Action.
- SaaS Platform: Leverage an all-in-one solution with no setup or installation required.
- Commercial Support: Benefit from prompt, professional guidance to maintain an optimal testing workflow.
Testimonials
"The world needs modern, spec-based API tests, so we can deliver APIs as-designed. Schemathesis is the right tool for that job."
"Schemathesis is the only sane way to thoroughly test an API."
"The tool is absolutely amazing as it can do the negative scenario testing instead of me and much faster! Before I was doing the same tests in Postman client. But it's much slower and brings maintenance burden."
"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."
How does it work?
Schemathesis uses your API's schema to generate both valid and invalid test scenarios, helping you verify API compliance and catch potential issues. It also verifies examples from the schema itself.
Schemathesis generates high quality, diverse test data based on novel techniques like Swarm testing or Schema fuzzing, ensuring that your API is thoroughly tested and even the most elusive bugs are uncovered.
It's a versatile tool that works with any language, as long as you have an API schema in a supported format.
Learn more about how it works in our research paper.
Why use Schemathesis?
- Avoid Crashes: Discover API-breaking payloads and avoid crashes, database corruption, and hangs.
- Keep API Documentation Up-to-Date: With Schemathesis, you never have to worry about API consumers using outdated specifications or incorrect payload examples.
- Easy Debugging: Schemathesis provides you with a detailed failure report, along with a single cURL command to help you reproduce the problem instantly.
- Increased Confidence in API Stability: By thoroughly testing your API with Schemathesis, you can have peace of mind knowing that your API is functioning as intended.
- Thorough Testing Coverage: Schemathesis generates a large number of scenarios to test your API against, giving you a comprehensive view of its behavior and potential issues.
- Time-Saving: Schemathesis streamlines API testing, saving your time for other tasks.
Getting started
Schemathesis can be used as a CLI, a Python library, a GitHub app, or as a SaaS.
- CLI: Quick and easy way to get started, for those who prefer the command line.
- Python Library: More control and customization, for developers integrating with their codebase.
- GitHub App: Direct testing in your GitHub repositories with reports in your pull requests.
- SaaS: No setup or installation, if you prefer an all-in-one solution with great visuals. Free tier included.
Installation
bash
python -m pip install schemathesis
This command installs the st entrypoint.
You can also use our Docker image without installing Schemathesis as a Python package:
bash
docker pull schemathesis/schemathesis:stable
If you use GitHub, there is a native GitHub app that reports test results directly to your pull requests.
Example
GitHub Actions
yaml
api-tests:
runs-on: ubuntu-20.04
steps:
# Runs Schemathesis tests with all checks enabled
- uses: schemathesis/action@v1
with:
# Your API schema location
schema: "http://localhost:5000/api/openapi.json"
# OPTIONAL. Your Schemathesis.io token
token: ${{ secrets.SCHEMATHESIS_TOKEN }}
Check our GitHub Action for more details.
Command line
```bash st run --checks all https://example.schemathesis.io/openapi.json
Or
docker run schemathesis/schemathesis:stable \ run --checks all https://example.schemathesis.io/openapi.json ```

Python tests
```python import schemathesis
schema = schemathesis.from_uri("https://example.schemathesis.io/openapi.json")
@schema.parametrize() def testapi(case): case.calland_validate() ```
Choose CLI for simplicity or Python package for greater flexibility. Both options run extensive tests and report failures with reproduction instructions.
💡 See a complete working example project in the /example directory.💡
Let's make it better together 🤝
We're always looking to make Schemathesis better, and your feedback is a crucial part of that journey! If you've got a few minutes, we'd love to hear your thoughts on your experience using Schemathesis.
Just follow this link to let us know what you think 💬
Thanks for helping us make Schemathesis even better! 👍
Commercial support
For assistance with integrating Schemathesis into your company workflows or improving its effectiveness, reach out to our support team at support@schemathesis.io. Additionally, we offer commercial support for those looking for extra assurance and priority assistance.
Contributing
Any contribution to development, testing, or any other area is highly appreciated and useful to the project. For guidance on how to contribute to Schemathesis, see the contributing guidelines.
Additional content
- Deriving Semantics-Aware Fuzzers from Web API Schemas by @Zac-HD and @Stranger6667
- An article about Schemathesis by @Stranger6667
- Effective API schemas testing from DevConf.cz by @Stranger6667
- How to use Schemathesis to test Flask API in GitHub Actions by @lina-is-here
- Testing APIFlask with schemathesis by @pamelafox
- A video from EuroPython 2020 by @hultner
- Schemathesis tutorial with an accompanying video by Red Hat
- Using Hypothesis and Schemathesis to Test FastAPI by @amalshaji
- A tutorial (RUS) about Schemathesis by @Stranger6667
License
This project is licensed under the terms of the MIT license.
Owner
- Name: Pexip
- Login: pexip
- Kind: organization
- Location: Oslo, Norway
- Website: https://pexip.com
- Repositories: 935
- Profile: https://github.com/pexip
GitHub Events
Total
- Push event: 3
- Create event: 6
Last Year
- Push event: 3
- Create event: 6
Dependencies
- actions/checkout v3.0.0 composite
- actions/setup-python v3.1.0 composite
- ammaraskar/sphinx-action master composite
- codecov/codecov-action v3.0.0 composite
- actions/checkout v3.0.0 composite
- github/codeql-action/analyze v2.1.8 composite
- github/codeql-action/autobuild v2.1.8 composite
- github/codeql-action/init v2.1.8 composite
- actions/checkout v3.0.0 composite
- aevea/commitsar v0.18.0 composite
- actions/checkout v3.0.0 composite
- actions/setup-python v4 composite
- schemathesis/action v1 composite
- postgres * docker
- schemathesis/action v1 composite
- actions/checkout v3.0.0 composite
- aevea/action-kaniko v0.6.2 composite
- actions/checkout v3.0.0 composite
- actions/setup-python v3.1.0 composite
- aevea/action-kaniko v0.6.2 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/checkout v3.0.0 composite
- actions/setup-python v3.1.0 composite
- python 3.10-alpine build
- python 3.10.5-slim build
- postgres 14
- sphinx ==5.3.0
- sphinx-click ==4.3.0
- sphinx_rtd_theme ==1.1.1
- asyncpg *
- connexion *
- pytest *
- schemathesis *
- aiohttp ==3.8.5
- aiohttp-jinja2 ==1.5
- aiosignal ==1.2.0
- anyio ==3.6.1
- async-timeout ==4.0.2
- asyncpg ==0.26.0
- attrs ==21.4.0
- certifi ==2023.7.22
- charset-normalizer ==2.0.12
- click ==8.1.3
- clickclick ==20.10.2
- colorama ==0.4.5
- connexion ==2.14.0
- curlify ==2.2.1
- flask ==2.1.3
- frozenlist ==1.3.0
- graphql-core ==3.2.1
- hypothesis ==6.53.0
- hypothesis-graphql ==0.9.0
- hypothesis-jsonschema ==0.22.0
- idna ==3.3
- inflection ==0.5.1
- iniconfig ==1.1.1
- itsdangerous ==2.1.2
- jinja2 ==3.1.2
- jsonschema ==4.7.2
- junit-xml ==1.9
- markupsafe ==2.1.1
- multidict ==6.0.2
- packaging ==21.3
- pluggy ==1.0.0
- py ==1.11.0
- pyparsing ==3.0.9
- pyrsistent ==0.18.1
- pytest ==7.1.2
- pytest-subtests ==0.7.0
- pyyaml ==6.0
- requests ==2.27.1
- schemathesis ==3.16.0
- six ==1.16.0
- sniffio ==1.2.0
- sortedcontainers ==2.4.0
- starlette ==0.27.0
- swagger-ui-bundle ==0.0.9
- tomli ==2.0.1
- tomli-w ==1.0.0
- typing-extensions ==4.3.0
- urllib3 ==1.26.11
- werkzeug ==2.1.2
- yarl ==1.7.2
- PyYAML >=5.1,<7.0
- backoff >=2.1.2,<3.0
- click >=7.0,<9.0
- colorama >=0.4,<1.0
- curlify >=2.2.1,<3.0
- httpx >=0.22.0,<1.0
- hypothesis >=6.31.6,<7
- hypothesis_graphql >=0.9.0,<1
- hypothesis_jsonschema >=0.22.1,<1
- importlib_metadata >=1.1,!=3.8,<5; python_version<'3.8'
- jsonschema >=4.3.2,<5.0
- junit-xml >=1.9,<2.0
- pyrate-limiter >=2.10,<3.0
- pytest >=4.6.4,<8
- pytest-subtests >=0.2.1,<0.8.0
- requests >=2.22,<3
- starlette >=0.13,<1
- starlette-testclient ==0.2.0
- tomli >=2.0.1,<3.0
- tomli-w >=1.0.0,<2.0
- typing-extensions >=3.7,<5
- werkzeug >=0.16.0,<=3
- yarl >=1.5,<2.0