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.7.6.tar.gz (184.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-4.7.6-py3-none-any.whl (243.3 kB view details)

Uploaded Python 3

hypothesis-4.7.6-py2-none-any.whl (243.3 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-4.7.6.tar.gz
Algorithm Hash digest
SHA256 5d5c3bef4c206ddb06c82faf33bd91f4598447b35b3d695adeba9ec28f80f5af
MD5 5081ea2fe94f659f88bde3465afbd013
BLAKE2b-256 241544b26c397c45da3b04cb5de9983ec6444dfc8922cdb1dba0d8f4f6855201

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hypothesis-4.7.6-py3-none-any.whl
  • Upload date:
  • Size: 243.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for hypothesis-4.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 00b539fb7c4ca042590f6f0d6cb5875c72085d14087ee0ec7a53518f2fcd1bba
MD5 e927165a9cfec22b8a6c25adfdb902b6
BLAKE2b-256 c2a86f4bc1b5d00ee870123033d2c9eaf0e98a65d2ebd8a96c86bb28d56e814d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hypothesis-4.7.6-py2-none-any.whl
Algorithm Hash digest
SHA256 bec551aa2d0b9b5b56887c56102b8168262e18d4a7515e47b4d5977737c97969
MD5 be3fa073c66c5ef16b503f9fc74280a8
BLAKE2b-256 9797d20340d7dbbb56d21fa0bd1a4c897ed22103eedbcd041c853304e0afe029

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