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.16.0.tar.gz (95.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.16.0-py3-none-any.whl (143.3 kB view details)

Uploaded Python 3

hypothesis-3.16.0-py2-none-any.whl (143.3 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.16.0.tar.gz
Algorithm Hash digest
SHA256 01a9be904fbb8c792fad5e5574affd62ec510a93047ef272864d9817ddbfd32e
MD5 04b022e773fd3fb589939ff1d8239372
BLAKE2b-256 d616ba51c29d32f4e94272e56112a62fd95003054dcd60511bd1e8ea5bbb14f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92cc8679db36e71a0793bd9664daa933ad74f6a59196917a3ab4a3a0d0d918df
MD5 ae1ef7a58be2c134c4d1a156ff615a22
BLAKE2b-256 153e381df53b20d9ba68093762acc91a5890ee323067d8ed2deff8eded1f2300

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.16.0-py2-none-any.whl
Algorithm Hash digest
SHA256 818b147dd920d4a0e5b34179145dd0f89aa0a2dc96ea83c6f70b052c5a19a25b
MD5 60ead400c2747d55d1d5f49df084f2d0
BLAKE2b-256 ba5692b8c63e67009924beb9d8f756c5517ba20ac49425a939d6086eafe36a29

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