Skip to main content

A library for property based testing

Project description

Hypothesis is an advanced testing library for Python. It lets you write tests which are parametrized by a source of examples, and then generates simple and comprehensible examples that make your tests fail. This lets you find more bugs in your code with less work.

e.g.

@given(st.lists(
  st.floats(allow_nan=False, allow_infinity=False), min_size=1))
def test_mean(xs):
    assert min(xs) <= mean(xs) <= max(xs)
Falsifying example: test_mean(
  xs=[1.7976321109618856e+308, 6.102390043022755e+303]
)

Hypothesis is extremely practical and advances the state of the art of unit testing by some way. It’s easy to use, stable, and powerful. If you’re not using Hypothesis to test your project then you’re missing out.

Quick Start/Installation

If you just want to get started:

pip install hypothesis

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

hypothesis-3.66.7.tar.gz (164.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hypothesis-3.66.7-py3-none-any.whl (216.8 kB view details)

Uploaded Python 3

hypothesis-3.66.7-py2-none-any.whl (216.8 kB view details)

Uploaded Python 2

File details

Details for the file hypothesis-3.66.7.tar.gz.

File metadata

  • Download URL: hypothesis-3.66.7.tar.gz
  • Upload date:
  • Size: 164.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hypothesis-3.66.7.tar.gz
Algorithm Hash digest
SHA256 ab7426a4999bfdc3a1e8bf068fe9fe187d9f19eb91ac7025b475c44843846bf5
MD5 db2dcdec753033880b178653aae8ed19
BLAKE2b-256 6cdbf17a39983b92b8030c9809f1286818f925dd2c5871f2dff5992d3880be03

See more details on using hashes here.

File details

Details for the file hypothesis-3.66.7-py3-none-any.whl.

File metadata

File hashes

Hashes for hypothesis-3.66.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6ce338a70e95bfb428d7b41d67184c7e06c610dd81ff253d8afae12838483efc
MD5 84b1000a49b0410546a91b2f8b32ff19
BLAKE2b-256 3955df0c12dffdc89110b5bfb029666a2b08b018740621f376b272b047153bc3

See more details on using hashes here.

File details

Details for the file hypothesis-3.66.7-py2-none-any.whl.

File metadata

File hashes

Hashes for hypothesis-3.66.7-py2-none-any.whl
Algorithm Hash digest
SHA256 ea2542fd5980d49ddb1825d1ef6918d692252d253b030b748b4fc65910363739
MD5 75e8a02d7d9c465d35f8237ccf3a1837
BLAKE2b-256 1e14c520283f48d9d24b9b75dce0421b10c501be0606e17dc0accc7ea6cca31c

See more details on using hashes here.

Supported by

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