==========
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/74/63/3bd21f02b0bf184c7287bf990e380f35c30e916f07590de1d134bca76ee7/hypothesis-6.119.4.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.119.4",
"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": "b388b6deb8736da63acd3b39855ec56c7672277a9594b77656a7a598cea49ed9",
"md5": "7e0f99de1888ce9bbccb254f95b7869b",
"sha256": "333958da7855048850c3d2b6a929d44a3c89ca9eafcfddcacc3570140915eba5"
},
"downloads": -1,
"filename": "hypothesis-6.119.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7e0f99de1888ce9bbccb254f95b7869b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 473666,
"upload_time": "2024-11-22T07:29:27",
"upload_time_iso_8601": "2024-11-22T07:29:27.362121Z",
"url": "https://files.pythonhosted.org/packages/b3/88/b6deb8736da63acd3b39855ec56c7672277a9594b77656a7a598cea49ed9/hypothesis-6.119.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "74633bd21f02b0bf184c7287bf990e380f35c30e916f07590de1d134bca76ee7",
"md5": "36d4cdb8ab15ade2edf4a2026500a1d4",
"sha256": "1a7d12709c0e96c1d85aca76d1594b34b5958623e00511592eba674acd4f3392"
},
"downloads": -1,
"filename": "hypothesis-6.119.4.tar.gz",
"has_sig": false,
"md5_digest": "36d4cdb8ab15ade2edf4a2026500a1d4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 412508,
"upload_time": "2024-11-22T07:29:30",
"upload_time_iso_8601": "2024-11-22T07:29:30.157885Z",
"url": "https://files.pythonhosted.org/packages/74/63/3bd21f02b0bf184c7287bf990e380f35c30e916f07590de1d134bca76ee7/hypothesis-6.119.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-22 07:29:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "HypothesisWorks",
"github_project": "hypothesis",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hypothesis"
}