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.19.0.tar.gz (105.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.19.0-py3-none-any.whl (151.8 kB view details)

Uploaded Python 3

hypothesis-3.19.0-py2-none-any.whl (151.8 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.19.0.tar.gz
Algorithm Hash digest
SHA256 0b04715f6b01bbbbc884f4dc658d34633b23b9ccfbd9f31da2acd2e20391d402
MD5 825d3f7f1103a77ca19520f540f7589a
BLAKE2b-256 f786c559d0150c8ba610f313903ea7cd13fdf7cc8455c9341211541a651d9f90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e49518388f67ea7d6c3e6a18a340efd095dcc8c59e2eba8855823924a550b90
MD5 22ea4bed78f2d37c5633b41cb7e55d16
BLAKE2b-256 5c3fe7a04183568cf8f357f8b4963da235cbbcc618a9cc3545260628a3c7fa25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.19.0-py2-none-any.whl
Algorithm Hash digest
SHA256 29117893f05218ba1266b239660be9d6b2c5364a70c32a89ad3d55737d95a2d0
MD5 3815986e18774d0c834fab2ebec5fdf5
BLAKE2b-256 42b037e01ee701eedebc38f6f9acfdc3e42077a529f83d6efe37aac875568750

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