hypothesis


Namehypothesis JSON
Version 6.116.0 PyPI version JSON
download
home_pagehttps://hypothesis.works
SummaryA library for property-based testing
upload_time2024-11-01 04:42:17
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/7a/30/666ef39bf82ab3a27581179cee68f51a8c51d1a59d635e96d6bcd15a2a11/hypothesis-6.116.0.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.116.0",
    "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": "7ba297052c42f46fca976cf2d5d37ecf547062f2cb66f54a4f95442cf6610697",
                "md5": "834adcbc8a82fcb085a4d40924b4ad76",
                "sha256": "d30271214eae0d4758b72b408e9777405c7c7f687e14e8a42853adea887b2891"
            },
            "downloads": -1,
            "filename": "hypothesis-6.116.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "834adcbc8a82fcb085a4d40924b4ad76",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 468978,
            "upload_time": "2024-11-01T04:42:14",
            "upload_time_iso_8601": "2024-11-01T04:42:14.129554Z",
            "url": "https://files.pythonhosted.org/packages/7b/a2/97052c42f46fca976cf2d5d37ecf547062f2cb66f54a4f95442cf6610697/hypothesis-6.116.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7a30666ef39bf82ab3a27581179cee68f51a8c51d1a59d635e96d6bcd15a2a11",
                "md5": "7032906770beb54a5eee74bc8a72bd38",
                "sha256": "9c1ac9a2edb77aacae1950d8ded6b3f40dbf8483097c88336265c348d2132c71"
            },
            "downloads": -1,
            "filename": "hypothesis-6.116.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7032906770beb54a5eee74bc8a72bd38",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 407919,
            "upload_time": "2024-11-01T04:42:17",
            "upload_time_iso_8601": "2024-11-01T04:42:17.475206Z",
            "url": "https://files.pythonhosted.org/packages/7a/30/666ef39bf82ab3a27581179cee68f51a8c51d1a59d635e96d6bcd15a2a11/hypothesis-6.116.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-01 04:42:17",
    "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.41513s