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.31.0.tar.gz (127.6 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.31.0-py3-none-any.whl (178.6 kB view details)

Uploaded Python 3

hypothesis-3.31.0-py2-none-any.whl (178.7 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.31.0.tar.gz
Algorithm Hash digest
SHA256 ddf9458222f5321375ec9e15816785c27d7ce420b3931dbe290bef06dbaf34c6
MD5 89b321aeb9cf90bdb7eb12a6c841a09e
BLAKE2b-256 42d9e7c2928641063a74dd1f570551f51670830de707f6aaac1f2af3043226df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.31.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc7d2b72f1b8e6cbe9bc93b769109b89b73c00cbd4eddef4db3af64e8e4ff4f3
MD5 68e441617dd5f8cf2787885bf539925b
BLAKE2b-256 5dc89e57c602de410b5c5100e243f5e6c54142e93e8f13ea9ca91708d36c0e42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.31.0-py2-none-any.whl
Algorithm Hash digest
SHA256 73546f55c8291a0d3f8778293d5c87e181a3a3354356156f4a0f3121fca006bc
MD5 72d70e42fc33e027ee16e0d8d2b3e3b6
BLAKE2b-256 75a68c5e881a06fd99167ec946759af33a9ada1348e9df4e4ee0a454c05ba154

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