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.3.tar.gz (163.4 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.3-py3-none-any.whl (215.9 kB view details)

Uploaded Python 3

hypothesis-3.66.3-py2-none-any.whl (215.9 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.66.3.tar.gz
Algorithm Hash digest
SHA256 f43a05751831abc584d574b753fd52767f270c254c347567996b0e8f614d9c9a
MD5 903180ab343e4b1fcb5751414e359f34
BLAKE2b-256 f8e99ff1cbcc55e318bc1ad63a6d7e9c82b2a41518df9dff31d8ecfc1b7a7c4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.66.3-py3-none-any.whl
Algorithm Hash digest
SHA256 61ca0b49c4c8949cc401e4fa617390748efb42e955cc7f287be12f4d11e7c551
MD5 8a418b16d544e5ee6aa70259d99cb50f
BLAKE2b-256 647b70559c621d0930d9fd94e9e07135baad5b71b6deb562167469328db831d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.66.3-py2-none-any.whl
Algorithm Hash digest
SHA256 a42cbc432d9388862aefc004eafe5ba39337a5a263adb655dd203b8aff7b75e4
MD5 d0ef2049ae13392d3b453fd97a480529
BLAKE2b-256 26a39a28caae2d5ac1bd6e212320599e5635b41ee9712ceb61c84d1eb6ca0198

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