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.66.0.tar.gz (162.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.66.0-py3-none-any.whl (214.8 kB view details)

Uploaded Python 3

hypothesis-3.66.0-py2-none-any.whl (214.8 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.66.0.tar.gz
Algorithm Hash digest
SHA256 046100c4e12ea3709656cc766e5acbd2d9c0238af4e2a0bff6f6693ff16154f4
MD5 ad0290b764c7216ea78cbfc66e10d839
BLAKE2b-256 ba502307e8740745ae9b94586e6eb923f2ba6a8cac6b6ec28b1f3a64690a4737

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.66.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49d43c97d9ff4b62fe5c46df8a09f0007326ce3d831a0349e02990f7a6269a50
MD5 820d7fd55077027bcccc7dcee79ea518
BLAKE2b-256 135fb0de6631d01914bf17388619856baf8e333f689a6ffa73821fe793c4bada

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.66.0-py2-none-any.whl
Algorithm Hash digest
SHA256 c770539352fc7cc646570c0abbd9180edf326a41afcf4f3208f9fcc1e7a9e87c
MD5 6c927dce2e2e718c229dd2bb64392676
BLAKE2b-256 9a317083529a4009828afba36c54c19db31aa92d2df2a423a11b3266100fff68

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