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.65.1.tar.gz (162.0 kB view details)

Uploaded Source

Built Distributions

hypothesis-3.65.1-py3-none-any.whl (214.4 kB view details)

Uploaded Python 3

hypothesis-3.65.1-py2-none-any.whl (214.4 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for hypothesis-3.65.1.tar.gz
Algorithm Hash digest
SHA256 eee51b25f923bfff663b37d4cacb7d46d2121c5322926a35e3a2314f1343e250
MD5 b3f1f2aeab87db7042acf800b0f787d1
BLAKE2b-256 bcef93e9b0aaf24396c01542818e8a5c09b1c43a7951ffadc41133c930151814

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.65.1-py3-none-any.whl
Algorithm Hash digest
SHA256 375d7608e7471f8952d29fed1a3296bdc3a5d6016fe9d508db96a9bdf6deb1f2
MD5 fd5a225c0feab01c99e1731c7d33d05f
BLAKE2b-256 226c3edd75f68d14dc9765a01f239af3aaa284a813532811c105e83eba554565

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis-3.65.1-py2-none-any.whl
Algorithm Hash digest
SHA256 c5aec92cc88c647232c60786c0b12ebebc79c83bfeae474f19244995b2eaa617
MD5 9da5a8e4ab6225e5f4ca118373ec204f
BLAKE2b-256 2d0ed6fd530acf413c8ee6d232a311848c85b50665080ae388a6252478c1394b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page