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-4.21.1.tar.gz (200.1 kB view details)

Uploaded Source

Built Distributions

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

hypothesis-4.21.1-py3-none-any.whl (260.2 kB view details)

Uploaded Python 3

hypothesis-4.21.1-py2-none-any.whl (260.3 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: hypothesis-4.21.1.tar.gz
  • Upload date:
  • Size: 200.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for hypothesis-4.21.1.tar.gz
Algorithm Hash digest
SHA256 53a6f91a4188a59aafca5066e4f6a2b8b20f43b3699c7e7b626da86ad621ef98
MD5 364986f0f861f7e40b397c8ae8c5fb25
BLAKE2b-256 20706cdfb12d6bd59e34255d1eb6b3ad59ddf5a1b6a926539ed76789c006bef7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hypothesis-4.21.1-py3-none-any.whl
  • Upload date:
  • Size: 260.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for hypothesis-4.21.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9280e2505a471a0a32b3c9096a03a5a825d3488dc8c103d3775e640b970dcd64
MD5 50f2cfde0f3ebaf52d5eadfb3cb7c5b0
BLAKE2b-256 8980545519efc3a6c66d3687c8dbdbf0891bbc63a8d7b94b945bffc142a222b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hypothesis-4.21.1-py2-none-any.whl
  • Upload date:
  • Size: 260.3 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for hypothesis-4.21.1-py2-none-any.whl
Algorithm Hash digest
SHA256 5dbf94fc987acfc8d042166e48ec5b450598c4b3333df2d676a87d584da1b0be
MD5 7dada324a1c58f6b0961061626ce5736
BLAKE2b-256 e50ac9b6a8125af85ba53379601ed94d084d56b46fbb2aff2a389d098867c6b8

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