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-4.22.0.tar.gz (200.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-4.22.0-py3-none-any.whl (260.5 kB view details)

Uploaded Python 3

hypothesis-4.22.0-py2-none-any.whl (260.5 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: hypothesis-4.22.0.tar.gz
  • Upload date:
  • Size: 200.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for hypothesis-4.22.0.tar.gz
Algorithm Hash digest
SHA256 7ce4ae1d94cbfc27b161b4ff9129916ab146ce8d8b30c1bab40c99579a0f042f
MD5 217d94c7f3495d496908738826114c5f
BLAKE2b-256 b01c18b23479c7aef760dc457cdd93ce767a86d52971f696d59bb400afff055b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hypothesis-4.22.0-py3-none-any.whl
  • Upload date:
  • Size: 260.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for hypothesis-4.22.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ba81ea07ce2b301892512dcdf6953623dec0e0d154ca3e48c40315a4bebe8be
MD5 9d0c41e7332a59e9f20a006205a01a2f
BLAKE2b-256 962e23813a8ca0239c01d0f4ef9f21f0985af474c8370fda134ed9f306874d04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hypothesis-4.22.0-py2-none-any.whl
  • Upload date:
  • Size: 260.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for hypothesis-4.22.0-py2-none-any.whl
Algorithm Hash digest
SHA256 4ef64defa59be8ecd3d5472a9b12f613b1679da42ff5efe183e3171b4e500708
MD5 bfb6a7ea1b94c656bc8ceae928b8ae2c
BLAKE2b-256 c5dd6ba363f413cc23622ad268ee94e95d0b52fb7f65e5cf95f722f729f59b54

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