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.64.1.tar.gz (161.5 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.64.1-py3-none-any.whl (213.9 kB view details)

Uploaded Python 3

hypothesis-3.64.1-py2-none-any.whl (213.9 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.64.1.tar.gz
Algorithm Hash digest
SHA256 15f26b40501a855fc52b150e6b1426970321c4cf06337f02a9c7df98c27462b5
MD5 5bb55bfcacd25d6156becf5d64647abd
BLAKE2b-256 4f8489c60add1a3fefa792ff9ccb4dae6eb190817d8a52caa3ba7d5de2a3dd71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.64.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cdc3c3ac20f4d5aa9ce2e873ee72166a7a6399fa3954628faa11ad13ca1d998c
MD5 96e3dd33dfbdb254b03935a2be0e40c8
BLAKE2b-256 1e37cd2e534bdcb00dd05a1864278d0447c597cead95e8640ac1c4b2c9aef8fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.64.1-py2-none-any.whl
Algorithm Hash digest
SHA256 ea8486f8d47f94894b98642eddd1bcd63ad6266079eac4185069a08670e778cd
MD5 f06a5f714402176260bddbc803a70e27
BLAKE2b-256 85da42b45dad74e24bce3f6194bce66aee2074d2dd6a4dc54b8abc72bf677ae1

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