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.13.0.tar.gz (88.6 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.13.0-py3-none-any.whl (135.6 kB view details)

Uploaded Python 3

hypothesis-3.13.0-py2-none-any.whl (135.6 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.13.0.tar.gz
Algorithm Hash digest
SHA256 b6a7a7d3928ecd906f186605c486d233236e6724aead873c6f6c944cf7c20701
MD5 543ec2cf0408b77073c45749e66b3346
BLAKE2b-256 e906fe0f06e1c3f725b6c2dad5d9d0607324aa2dc18814603509a6262ec3be66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48d6d42e9a4d7357fdcd2c8718a3e2ce399c830f49d73d4e35229e163a6a080b
MD5 79c39401b55bd11c237d75dda33e016c
BLAKE2b-256 b64c1a680a638c069a1b471db50af9b44a67851a1ea0cb05c98384ad90f7628f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.13.0-py2-none-any.whl
Algorithm Hash digest
SHA256 bd693f1baa8ef438fbdacf60a492ff912321cf2c6319708714ab591d91242bf6
MD5 9f1e601af6ecbee7e7fa09ed302ba0c1
BLAKE2b-256 67959a37802253a943e11b9af60854c3a409448a777c8b17cbee52bc1142a65a

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