hypothesis


Namehypothesis JSON
Version 6.123.1 PyPI version JSON
download
home_pagehttps://hypothesis.works
SummaryA library for property-based testing
upload_time2024-12-24 09:33:26
maintainerNone
docs_urlNone
authorDavid R. MacIver and Zac Hatfield-Dodds
requires_python>=3.9
licenseMPL-2.0
keywords python testing fuzzing property-based-testing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==========
Hypothesis
==========

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.

.. code-block:: python

  @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)

.. code-block::

  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:

.. code-block::

  pip install hypothesis


-----------------
Links of interest
-----------------

The main Hypothesis site is at `hypothesis.works <https://hypothesis.works/>`_, and contains a lot
of good introductory and explanatory material.

Extensive documentation and examples of usage are `available at readthedocs <https://hypothesis.readthedocs.io/en/latest/>`_.

If you want to talk to people about using Hypothesis, `we have both an IRC channel
and a mailing list <https://hypothesis.readthedocs.io/en/latest/community.html>`_.

If you want to receive occasional updates about Hypothesis, including useful tips and tricks, there's a
`TinyLetter mailing list to sign up for them <https://tinyletter.com/DRMacIver/>`_.

If you want to contribute to Hypothesis, `instructions are here <https://github.com/HypothesisWorks/hypothesis-python/blob/master/CONTRIBUTING.rst>`_.

If you want to hear from people who are already using Hypothesis, some of them `have written
about it <https://hypothesis.readthedocs.io/en/latest/endorsements.html>`_.

If you want to create a downstream package of Hypothesis, please read `these guidelines for packagers <https://hypothesis.readthedocs.io/en/latest/packaging.html>`_.

            

Raw data

            {
    "_id": null,
    "home_page": "https://hypothesis.works",
    "name": "hypothesis",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "python testing fuzzing property-based-testing",
    "author": "David R. MacIver and Zac Hatfield-Dodds",
    "author_email": "david@drmaciver.com",
    "download_url": "https://files.pythonhosted.org/packages/a1/10/92bed8bbec8d87e34ca665177efea0c061ce45abedbcc10a25d1f3f9067c/hypothesis-6.123.1.tar.gz",
    "platform": null,
    "description": "==========\nHypothesis\n==========\n\nHypothesis is an advanced testing library for Python. It lets you write tests which\nare parametrized by a source of examples, and then generates simple and comprehensible\nexamples that make your tests fail. This lets you find more bugs in your code with less\nwork.\n\ne.g.\n\n.. code-block:: python\n\n  @given(st.lists(st.floats(allow_nan=False, allow_infinity=False), min_size=1))\n  def test_mean(xs):\n      assert min(xs) <= mean(xs) <= max(xs)\n\n.. code-block::\n\n  Falsifying example: test_mean(\n    xs=[1.7976321109618856e+308, 6.102390043022755e+303]\n  )\n\nHypothesis is extremely practical and advances the state of the art of\nunit testing by some way. It's easy to use, stable, and powerful. If\nyou're not using Hypothesis to test your project then you're missing out.\n\n------------------------\nQuick Start/Installation\n------------------------\n\nIf you just want to get started:\n\n.. code-block::\n\n  pip install hypothesis\n\n\n-----------------\nLinks of interest\n-----------------\n\nThe main Hypothesis site is at `hypothesis.works <https://hypothesis.works/>`_, and contains a lot\nof good introductory and explanatory material.\n\nExtensive documentation and examples of usage are `available at readthedocs <https://hypothesis.readthedocs.io/en/latest/>`_.\n\nIf you want to talk to people about using Hypothesis, `we have both an IRC channel\nand a mailing list <https://hypothesis.readthedocs.io/en/latest/community.html>`_.\n\nIf you want to receive occasional updates about Hypothesis, including useful tips and tricks, there's a\n`TinyLetter mailing list to sign up for them <https://tinyletter.com/DRMacIver/>`_.\n\nIf you want to contribute to Hypothesis, `instructions are here <https://github.com/HypothesisWorks/hypothesis-python/blob/master/CONTRIBUTING.rst>`_.\n\nIf you want to hear from people who are already using Hypothesis, some of them `have written\nabout it <https://hypothesis.readthedocs.io/en/latest/endorsements.html>`_.\n\nIf you want to create a downstream package of Hypothesis, please read `these guidelines for packagers <https://hypothesis.readthedocs.io/en/latest/packaging.html>`_.\n",
    "bugtrack_url": null,
    "license": "MPL-2.0",
    "summary": "A library for property-based testing",
    "version": "6.123.1",
    "project_urls": {
        "Changelog": "https://hypothesis.readthedocs.io/en/latest/changes.html",
        "Documentation": "https://hypothesis.readthedocs.io",
        "Homepage": "https://hypothesis.works",
        "Issues": "https://github.com/HypothesisWorks/hypothesis/issues",
        "Source": "https://github.com/HypothesisWorks/hypothesis/tree/master/hypothesis-python"
    },
    "split_keywords": [
        "python",
        "testing",
        "fuzzing",
        "property-based-testing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "54bcd7dcb30183f0a5bbbff008a7d0a231b1a4301272e771c5f13af2c3a44872",
                "md5": "e288abea7902af59f71b06819fb4aeaa",
                "sha256": "acf177faeff578f02afef2744c00b9ec3ce03f3b72ffbb6d7013f7baeebaac5e"
            },
            "downloads": -1,
            "filename": "hypothesis-6.123.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e288abea7902af59f71b06819fb4aeaa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 480140,
            "upload_time": "2024-12-24T09:33:22",
            "upload_time_iso_8601": "2024-12-24T09:33:22.112120Z",
            "url": "https://files.pythonhosted.org/packages/54/bc/d7dcb30183f0a5bbbff008a7d0a231b1a4301272e771c5f13af2c3a44872/hypothesis-6.123.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a11092bed8bbec8d87e34ca665177efea0c061ce45abedbcc10a25d1f3f9067c",
                "md5": "cdd836818d94fcb5ea91666a4cf27348",
                "sha256": "eb2bf646537ad818270feff6428c34f57813a4ef78781861ec1693b0840ab1d8"
            },
            "downloads": -1,
            "filename": "hypothesis-6.123.1.tar.gz",
            "has_sig": false,
            "md5_digest": "cdd836818d94fcb5ea91666a4cf27348",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 418131,
            "upload_time": "2024-12-24T09:33:26",
            "upload_time_iso_8601": "2024-12-24T09:33:26.743663Z",
            "url": "https://files.pythonhosted.org/packages/a1/10/92bed8bbec8d87e34ca665177efea0c061ce45abedbcc10a25d1f3f9067c/hypothesis-6.123.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-24 09:33:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "HypothesisWorks",
    "github_project": "hypothesis",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "hypothesis"
}
        
Elapsed time: 0.57652s