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

Uploaded Source

Built Distributions

hypothesis-3.22.0-py3-none-any.whl (154.9 kB view details)

Uploaded Python 3

hypothesis-3.22.0-py2-none-any.whl (154.9 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.22.0.tar.gz
Algorithm Hash digest
SHA256 d09772143e83cb6dab7fc8be05b8c842e13c97251d220b4d1cd6a1634626d302
MD5 dcee2c0eb052b49e5f4354e41dda16bf
BLAKE2b-256 7cf6eb48c548fd13cc54969abc463ada4cbe00327f665e7321ece58fefb9e4d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.22.0-py3-none-any.whl
Algorithm Hash digest
SHA256 267dca0e1abd73089688a4b72c45cb6aa07a75127b313114e984dc44324d7afb
MD5 84fd41b84c7bd9b0c6debce83018f58a
BLAKE2b-256 709800581e71e1aad178db31dd40d533b82a0bb036883820e59e075433c5ed54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.22.0-py2-none-any.whl
Algorithm Hash digest
SHA256 1802d8fd9ea08c37296c63da2ce38cb28aae0f738bb8d4bc5d531018813d9474
MD5 4a17f36f2de5cb964d358a61323e342f
BLAKE2b-256 16f72c4bf6b7b591f22f406689eb3209b62e8fbdff05e2fa9534582226724d47

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page