hypothesis 6.131.0
pip install hypothesis
Released:
A library for property-based testing
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
-
License Expression: MPL-2.0
SPDX License Expression - Author: David R. MacIver and Zac Hatfield-Dodds
- Tags python, testing, fuzzing, property-based-testing
- Requires: Python >=3.9
-
Provides-Extra:
cli
,codemods
,ghostwriter
,pytz
,dateutil
,lark
,numpy
,pandas
,pytest
,dpcontracts
,redis
,crosshair
,zoneinfo
,django
,watchdog
,all
Classifiers
- Development Status
- Framework
- Intended Audience
- Operating System
- Programming Language
- Topic
- Typing
Project description
Hypothesis
Hypothesis is the property-based testing library for Python. With Hypothesis, you write tests which should pass for all inputs in whatever range you describe, and let Hypothesis randomly choose which of those inputs to check - including edge cases you might not have thought about. For example:
from hypothesis import given, strategies as st
@given(st.lists(st.integers()))
def test_matches_builtin(ls):
assert sorted(ls) == my_sort(ls)
This randomized testing can catch bugs and edge cases that you didn't think of and wouldn't have found. In addition, when Hypothesis does find a bug, it doesn't just report any failing example — it reports the simplest possible one. This makes property-based tests a powerful tool for debugging, as well as testing.
For instance,
def my_sort(ls):
return sorted(set(ls))
fails with the simplest possible failing example:
Falsifying example: test_matches_builtin(ls=[0, 0])
Installation
To install Hypothesis:
pip install hypothesis
There are also optional extras available.
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
-
License Expression: MPL-2.0
SPDX License Expression - Author: David R. MacIver and Zac Hatfield-Dodds
- Tags python, testing, fuzzing, property-based-testing
- Requires: Python >=3.9
-
Provides-Extra:
cli
,codemods
,ghostwriter
,pytz
,dateutil
,lark
,numpy
,pandas
,pytest
,dpcontracts
,redis
,crosshair
,zoneinfo
,django
,watchdog
,all
Classifiers
- Development Status
- Framework
- Intended Audience
- Operating System
- Programming Language
- Topic
- Typing
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
Built Distribution
File details
Details for the file hypothesis-6.131.0.tar.gz
.
File metadata
- Download URL: hypothesis-6.131.0.tar.gz
- Upload date:
- Size: 430.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b807daeeee47852edfd9818ba0e33df14902f1b78a5524f1a3fb71f80c7cec3 |
|
MD5 | ae7b44d6ce515cae7e2efada2f13a252 |
|
BLAKE2b-256 | 737982eaf131f58a5c434830f0c196995a5071531765c51ebc8aaff493002b5e |
File details
Details for the file hypothesis-6.131.0-py3-none-any.whl
.
File metadata
- Download URL: hypothesis-6.131.0-py3-none-any.whl
- Upload date:
- Size: 495.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 734959017e3ee4ef8f0ecb4e5169c8f4cf96dc83a997d2edf01fb5350f5bf2f4 |
|
MD5 | 7a725a269bf885971b0610a14bbed3fe |
|
BLAKE2b-256 | 0143b5e5d397e1ece9b71584c1771214b4a643d81fa8f197d4ff5938295ead25 |