.. raw:: html Welcome to Hypothesis! ====================== Hypothesis is the property-based testing library for Python. With Hypothesis, you write tests which should pass for all inputs in whatever range you describe, and let Hypothesis randomly choose which of those inputs to check - including edge cases you might not have thought about. For example: .. code-block:: python from hypothesis import given, strategies as st @given(st.lists(st.integers() | st.floats())) def test_sort_correct(lst): # lst is a random list of numbers assert my_sort(lst) == sorted(lst) test_sort_correct() You should start with the :doc:`tutorial `, or the more condensed :doc:`quickstart `. .. rst-class:: clearfix row .. rst-class:: column column2 top-left :doc:`Tutorial ` --------------------------------- An introduction to Hypothesis. New users should start here, or with the more condensed :doc:`quickstart `. .. rst-class:: column column2 top-right :doc:`How-to guides ` ----------------------------------- Practical guides for applying Hypothesis in specific scenarios. .. rst-class:: column column2 bottom-left :doc:`Explanations ` --------------------------------------- Commentary oriented towards deepening your understanding of Hypothesis. .. rst-class:: column column2 bottom-right :doc:`API Reference ` -------------------------------------- Technical API reference. .. rst-class:: clearfix row .. toctree:: :maxdepth: 1 :hidden: quickstart tutorial/index how-to/index explanation/index reference/index stateful Extras changelog .. toctree:: :maxdepth: 1 :hidden: :caption: About Hypothesis development compatibility usage extensions packaging community