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.40.0.tar.gz (132.5 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.40.0-py3-none-any.whl (183.7 kB view details)

Uploaded Python 3

hypothesis-3.40.0-py2-none-any.whl (183.7 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.40.0.tar.gz
Algorithm Hash digest
SHA256 bb125e10ca15e850667464725ff07ed177f68eaf87c80cc3d731d53d7ad323eb
MD5 d3806f101bf4b7074e0ace79286ebc21
BLAKE2b-256 3ed18965613c8df4145ac1b12676fb4311b275ac2ca772c3235c6880d5f0e1b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.40.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53deb9f10f2802ef28c2a225cb7b288fa2c1f870b9594665617e3fea315062dd
MD5 ce875617ef5e53a3b2ac4707c51a2db0
BLAKE2b-256 416d64fb80173fa47d9badf1521ce3b8e8cee8db203607ce9734fa3797d957bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.40.0-py2-none-any.whl
Algorithm Hash digest
SHA256 26f4031c45398afbb661e3141a40080c9ce2adcc0782ed33d3ddc135b3254a66
MD5 2f76815097bd66a7cba194f9302adf3e
BLAKE2b-256 f0c5408665f37d08a03dd6d051cd72cab030a2345f017c61c131861dcf8c6fd5

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