MCPcopy Index your code
hub / github.com/HypothesisWorks/hypothesis

github.com/HypothesisWorks/hypothesis @v6.156.0

repository ↗ · DeepWiki ↗ · release v6.156.0 ↗ · Ask this repo → · + Follow
7,006 symbols 28,620 edges 458 files 718 documented · 10% 8 cross-repo links updated todayv6.156.0 · 2026-07-02★ 8,75539 open issues
README

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:

from hypothesis import given, strategies as st


@given(st.lists(st.integers()))
def test_matches_builtin(ls):
    assert sorted(ls) == my_sort(ls)

This randomized testing can catch bugs and edge cases that you didn't think of and wouldn't have found. In addition, when Hypothesis does find a bug, it doesn't just report any failing example — it reports the simplest possible one. This makes property-based tests a powerful tool for debugging, as well as testing.

For instance,

def my_sort(ls):
    return sorted(set(ls))

fails with the simplest possible failing example:

Falsifying example: test_matches_builtin(ls=[0, 0])

Installation

To install Hypothesis:

pip install hypothesis

There are also optional extras available.

Core symbols most depended-on inside this repo

draw
called by 457
hypothesis/src/hypothesis/strategies/_internal/core.py
minimal
called by 267
hypothesis/tests/common/debug.py
append
called by 218
hypothesis/src/hypothesis/internal/conjecture/junkdrawer.py
find_any
called by 214
hypothesis/tests/common/debug.py
check_can_generate_examples
called by 163
hypothesis/tests/common/debug.py
integers
called by 144
hypothesis/src/hypothesis/strategies/_internal/numbers.py
map
called by 120
hypothesis/src/hypothesis/strategies/_internal/misc.py
filter
called by 120
hypothesis/src/hypothesis/strategies/_internal/misc.py

Shape

Function 4,499
Method 1,658
Class 721
Route 128

Languages

Python100%
TypeScript1%

Modules by API surface

hypothesis/tests/cover/test_stateful.py242 symbols
hypothesis/tests/cover/test_lookup.py200 symbols
hypothesis/tests/cover/test_pretty.py135 symbols
hypothesis/tests/conjecture/test_engine.py126 symbols
hypothesis/tests/cover/test_reflection.py113 symbols
hypothesis/src/hypothesis/internal/conjecture/data.py112 symbols
hypothesis/tests/numpy/test_gen_data.py97 symbols
hypothesis/src/hypothesis/database.py96 symbols
hypothesis/src/hypothesis/strategies/_internal/core.py92 symbols
hypothesis/tests/cover/test_database_backend.py91 symbols
hypothesis/tests/conjecture/test_provider.py81 symbols
hypothesis/src/hypothesis/strategies/_internal/strategies.py78 symbols

For agents

$ claude mcp add hypothesis \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact