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.44.5.tar.gz (135.7 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.44.5-py3-none-any.whl (186.9 kB view details)

Uploaded Python 3

hypothesis-3.44.5-py2-none-any.whl (186.9 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.44.5.tar.gz
Algorithm Hash digest
SHA256 6738fcfa112464f796e21926a98d91506fcf7140b9dbeaaa98d983432c6fbad4
MD5 06d118889c102c492bf808084407c8ac
BLAKE2b-256 da580c57dac95bc374590ceb75c62141f6748012ceb35ab77870654600aea62a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.44.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ba5b850f814626649b17d7d64c5ae3156d9b09bce2c2d7b53859a07eb543c0f4
MD5 620f370d4d7f269d713ed36db0c64727
BLAKE2b-256 a301c05bc00efc1e4f4d464ff5c0bed4e85f4b27003d377d1863fe35f447b19b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.44.5-py2-none-any.whl
Algorithm Hash digest
SHA256 77ba0fba15b3e6d862693d890377664f3eb9fd55bf0bce4132c69e83d1dd034d
MD5 6fb2ce48f5b3bb8d0f8cd92296083d5d
BLAKE2b-256 4ef41c0e042c3ca5bc3756188f708e0e3d0fabd59a3c90f9a769535bc39752e3

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