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.21.2.tar.gz (105.7 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.21.2-py3-none-any.whl (155.2 kB view details)

Uploaded Python 3

hypothesis-3.21.2-py2-none-any.whl (155.2 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.21.2.tar.gz
Algorithm Hash digest
SHA256 56ec7cd11ab4586c1a47ccf5dbc70ede31d8c6c8fb71bcfb3149b1974ed9edba
MD5 46c6a7dea621ca34258a3af0b4d6e553
BLAKE2b-256 d5f79f9e7fe44e422546024a42c0ad6d6cb360589bafd27f0c772abfc8bcab16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.21.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e947f5081dfc3dc94abae76c9d714435518856e19798630a5e5e9035457598a
MD5 763ecdeacc7b124fa7fe470d49a6c0f6
BLAKE2b-256 8f2699ec88b8b031389659d4d967c869f4d29c0d69a90b9c00d1e57d83f01c6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.21.2-py2-none-any.whl
Algorithm Hash digest
SHA256 399acb229de7731a4e95faf28a64655602044d2564051528dab917cb03dadfff
MD5 ab28dc4c24bfbd85c3b84906748e45e7
BLAKE2b-256 669a756f50ea8ffd837a5de0468ee1a2ba540bc66e444b75bc6549382b316e30

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