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.12.0.tar.gz (86.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.12.0-py3-none-any.whl (132.4 kB view details)

Uploaded Python 3

hypothesis-3.12.0-py2-none-any.whl (132.5 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.12.0.tar.gz
Algorithm Hash digest
SHA256 057b2908aca157a36e3d227e5f97d7ac3e97eeeae861a543e8485fb6dace94a3
MD5 ea5a0e2d74c29800b98fa78fbcba3dfb
BLAKE2b-256 b3e0dabf8c4b5e565f11b4d716cb981bb235613d4ef6a1c9effb96284b751781

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cbedf584c085b4385de753b0d77a8c8b7a4aa818f6733409948c159db976e5c0
MD5 e125ba3516403d739dac0088549574ec
BLAKE2b-256 a2bc3eded13631266514d1f2623387f2aa6b678477c4432f27d5a3bb857f227a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.12.0-py2-none-any.whl
Algorithm Hash digest
SHA256 c3908ee381ee19b4b56ba3abc852150db8d88a0de2f46dc6f5507a0adac030c1
MD5 4e1d08fd04f5ff800e555c6c476c88ad
BLAKE2b-256 f1b26ff6d795632795b319f5a5ff69c543a8c48d211b6768994e859c88f348ac

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