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.28.1.tar.gz (118.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.28.1-py3-none-any.whl (168.4 kB view details)

Uploaded Python 3

hypothesis-3.28.1-py2-none-any.whl (168.4 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.28.1.tar.gz
Algorithm Hash digest
SHA256 9a1821b7f2fabf4aeff8f7a3f04e7108b733ae22cb9dc821950673666001a22d
MD5 265ba1828b53bdade4d08bdccd2e8fc7
BLAKE2b-256 e6de372a03f2e71d612d2b7c01f61bcde4a4069bca94689cbc09894dc39d4cd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.28.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a34b84ad6a2902aca97bbbe1951bd8002defd7619fe17b719967c5fe58659aed
MD5 540e1e7f959312026705876cd99f903f
BLAKE2b-256 67b0302f3fe57c5cb5cb4fc6f3b1f740ebd7b41d09a8ce82fde5de801cda63f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.28.1-py2-none-any.whl
Algorithm Hash digest
SHA256 931e7e859eb47cb6fbe48c85202955c342ce446326f14706844f2c2ff6bb4524
MD5 ecbec1c6560a95cb10b55c355427c05d
BLAKE2b-256 8889355152ef59b2f49505d5d698039258c9a3f0174af5188aa69e28a432091e

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