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.66.4.tar.gz (163.8 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.66.4-py3-none-any.whl (216.2 kB view details)

Uploaded Python 3

hypothesis-3.66.4-py2-none-any.whl (216.3 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.66.4.tar.gz
Algorithm Hash digest
SHA256 06db07bdeff23a1100fe790c3f8cb753d0026df07caddab9e61c73e76000d197
MD5 be72c568fbdd037414a7ab14a97c6870
BLAKE2b-256 bcdea479b83c43cebfc282611e6bd280e46d03570549f51cd8c0c0c88a0c3ff3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.66.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f17cca5c1445004d493b4da303066ba3b15af9b25e3a409a58c87227271dcaae
MD5 0fc7962c4f2b58ac8e50f80d5068976e
BLAKE2b-256 37d4b091cc7ff3adfaf10a468483af63d381551e60538b9c704218d212310d64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.66.4-py2-none-any.whl
Algorithm Hash digest
SHA256 612d60d8b47496ead2f4de17b5e586f882aa41a1a8e21d99257a21693a0e1091
MD5 30a2efee52f0245835f1fa99e6043ac8
BLAKE2b-256 5e21f2fec1357261e2a6f4d228d27bad1b26e672e1439c37939074983e29d30a

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