Hypothesis is now thread-safe

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Python teams running Hypothesis tests can now execute them in parallel threads, removing one blocker for testing packages against the free-threaded Python build.

Read this as

Hypothesis is a popular Python testing tool that automatically invents thousands of odd test inputs, like strange lists of numbers, to catch bugs developers would miss. Until now it couldn't safely run multiple tests at the same time in parallel. Python is preparing to remove a long-standing bottleneck (its 'GIL') so programs can truly run in parallel, and packages now need parallel testing. Hypothesis contributor Liam DeVoe, funded by Quansight, made the tool safe for this.

Python's move to free threading (removing its global interpreter lock, per PEP 703) requires libraries to prove thread safety, but Hypothesis tests were being skipped in those runs, cutting test coverage across many packages. Quansight sponsored contributor Liam DeVoe to fix this, so that coverage gap is now closed. Any Python team planning free-threaded migration benefits immediately; there are no costs or benchmarks stated.

Hypothesis, the property-based Python testing library (e.g. @given(st.lists(st.integers()))), is now thread-safe, thanks to contributor Liam DeVoe with Quansight sponsorship. Previously tests had to run sequentially, and community packages skipped Hypothesis suites under the free-threaded build (PEP 703), losing substantial coverage. Running tests in two or more concurrent threads is now viable. The article gives no implementation details, version number or performance figures.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Hypothesis Python Quansight PEP 703 GIL

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading