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.18.4.tar.gz (98.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.18.4-py3-none-any.whl (145.9 kB view details)

Uploaded Python 3

hypothesis-3.18.4-py2-none-any.whl (146.0 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.18.4.tar.gz
Algorithm Hash digest
SHA256 d1891577dc6d1c8d3ba9d1eb39add3bd82bb1c8566313578b89a37e20a49b5f4
MD5 9b4efabe01adc7c98c307a757f7c549d
BLAKE2b-256 54309ebd5b22820e33b809aaac35b9096c6a1ca8ff6b156e32ac575c0198a30a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.18.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f4968d6c440a5959518674745483ee0ec914f85ee9977abeac9d027572cff77c
MD5 07e1ee0774faa91eab0ccfd0f4d8b4d5
BLAKE2b-256 1ae2bdea5e6f3547d5bcefd976319530225a76c5b593d59c91db7827032d7740

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.18.4-py2-none-any.whl
Algorithm Hash digest
SHA256 4d1b28ef2dfae1feef7a7ffec8eebb310ddb1dd41b64d939321010d96dbffeb7
MD5 88707cefa10779208d0bbf6b121e9967
BLAKE2b-256 ecabd0a3a81e990f6c09ab7f223c361c0379048ea7f5221af64d3218d9b30d08

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