hypothesis


Namehypothesis JSON
Version 6.122.1 PyPI version JSON
download
home_pagehttps://hypothesis.works
SummaryA library for property-based testing
upload_time2024-12-01 19:54:27
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/14/f8/df54aa8eed240c09a859ea2d8fca18f011f8cec61d5cf831485e6b20e456/hypothesis-6.122.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.122.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": "2893aec17891c56dbf038da6ed4f8b3bcfd4f0cc706ac4af0084a7eefad9080d",
                "md5": "c1e4b3b3f21ac5d30300c553c52ef562",
                "sha256": "59e52da0f2529b40f0b7bd0c3c61d8b3fe3337102800bf3534c53d4a8bdf8a6d"
            },
            "downloads": -1,
            "filename": "hypothesis-6.122.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c1e4b3b3f21ac5d30300c553c52ef562",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 474926,
            "upload_time": "2024-12-01T19:54:23",
            "upload_time_iso_8601": "2024-12-01T19:54:23.999380Z",
            "url": "https://files.pythonhosted.org/packages/28/93/aec17891c56dbf038da6ed4f8b3bcfd4f0cc706ac4af0084a7eefad9080d/hypothesis-6.122.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "14f8df54aa8eed240c09a859ea2d8fca18f011f8cec61d5cf831485e6b20e456",
                "md5": "21ba10991cf5eb92db30f3d6707379bf",
                "sha256": "23280e802eef88316b02cb32205d74b5bf2e3de4a378e2579a8974117c512b83"
            },
            "downloads": -1,
            "filename": "hypothesis-6.122.1.tar.gz",
            "has_sig": false,
            "md5_digest": "21ba10991cf5eb92db30f3d6707379bf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 413630,
            "upload_time": "2024-12-01T19:54:27",
            "upload_time_iso_8601": "2024-12-01T19:54:27.155559Z",
            "url": "https://files.pythonhosted.org/packages/14/f8/df54aa8eed240c09a859ea2d8fca18f011f8cec61d5cf831485e6b20e456/hypothesis-6.122.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-01 19:54:27",
    "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.44210s