hypothesis 6.130.4
pip install hypothesis
Released:
A library for property-based testing
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Mozilla Public License 2.0 (MPL 2.0) (MPL-2.0)
- 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
- License
- Operating System
- Programming Language
- Topic
- Typing
Project description
Hypothesis
Hypothesis is the property-based testing library for Python. A property-based test asserts something for all inputs, and lets Hypothesis generate them — including inputs you may not have thought of.
from hypothesis import given, strategies as st
@given(st.lists(st.integers() | st.floats()))
def test_matches_builtin(ls):
assert sorted(ls) == my_sort(ls)
Additionally, when a property fails, Hypothesis 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 list(reversed(sorted(ls, reverse=True)))
fails with:
Falsifying example: test_matches_builtin(ls=[0, math.nan])
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: Mozilla Public License 2.0 (MPL 2.0) (MPL-2.0)
- 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
- License
- 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.130.4.tar.gz
.
File metadata
- Download URL: hypothesis-6.130.4.tar.gz
- Upload date:
- Size: 427.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0672eb0ac1060b0324b0e43925a50b2bef1c60a32739bb9233000d85838436a |
|
MD5 | e2f3c085890c91bed71857ed19327f50 |
|
BLAKE2b-256 | f93d199be3124dac341deb47747354a9e9ae2fa69f644229b5f3d0705a680cfd |
File details
Details for the file hypothesis-6.130.4-py3-none-any.whl
.
File metadata
- Download URL: hypothesis-6.130.4-py3-none-any.whl
- Upload date:
- Size: 491.3 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 | cda4a57115d10ecbefe0a9cc8d69d20a13eb56ecbfe7c24eaee5d368c2b7c477 |
|
MD5 | 3c96c6852e25784fc8bf8498e55cc377 |
|
BLAKE2b-256 | 5cd45a0c46cc8d266626cdc8082f07f836fa4a96e8715002de69be46ed406d1d |