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.34.0.tar.gz (129.0 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.34.0-py3-none-any.whl (179.4 kB view details)

Uploaded Python 3

hypothesis-3.34.0-py2-none-any.whl (179.4 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.34.0.tar.gz
Algorithm Hash digest
SHA256 591011e75261d04b2245981be73cf87ef06e074826c003c10ccd552ae86cf41a
MD5 e2d38d66ad65f5dca5157c4a7136e63a
BLAKE2b-256 df555c4702cf91b47b3e60dbac05d45504e71bc82659cebf4df928136613bbbe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.34.0-py3-none-any.whl
Algorithm Hash digest
SHA256 437536dd1ca1c964a9c7e9c59a0817b828b794e43b992b98ea58d18a4ab11154
MD5 abdbb33518810fa2091db9b67d2d67d0
BLAKE2b-256 e23c3603ad13125f1f95d626179abcdae9b832a2ebd818c870caa9bd93e91d97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.34.0-py2-none-any.whl
Algorithm Hash digest
SHA256 5824fd721d27479069b9edb105c2f536717a8cac8fc8158d9ece32ad813e0ec6
MD5 9b6576c099e029474e61b3b3bb102e3b
BLAKE2b-256 ff6b524bef30d7a33884e62bd17941186918d67389731dc2632e013e7b5420df

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