unstale

pypi / hypothesis

hypothesis

What changed in hypothesis 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.

7 breaking8 new APIs and options8 performance20 behavior and defaults7 tooling45 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.0 on npm

hypothesis 695 changes

Breaking changes 7

  • Support for Python 3.10 is dropped because it reached end of life in October 2026.

    6.169.0release notes

  • hypothesis.extra.pandas series(), indexes(), and column() accept timezone-aware dtypes, including coarser resolutions; generated values cover the representable range and include NaT unless the elements strategy excludes it. Requires pandas >= 2.1.

    6.162.0release notes

  • Building Hypothesis from source now requires a Rust toolchain unless installing from a native wheel.

    6.156.0release notes

  • dates() now raises InvalidArgument when a datetime is passed as min_value or max_value, instead of accepting the bounds and later failing with TypeError while generating examples.

    6.155.5release notes

  • Passing a dtype class where a dtype instance is expected now raises a clear error instead of a confusing message or silent coercion to the object dtype in arrays().

    6.155.0release notes

  • Generated dicts now vary iteration order instead of always placing required keys first, helping find code sensitive to key order. Use map(stable_sort_function) or similar for stable order.

    6.154.0release notes

  • The source code directory was renamed from hypothesis-python to hypothesis, which may affect tooling that relies on the directory name.

    6.152.10release notes

New APIs and options 8

  • Adds support for Python 3.16, which is still in alpha.

    6.170.2release notes

  • The .seed() method of randoms() accepts the same arguments as random.Random.seed(), including a= and version=. Calling it without a seed now raises a clearer error.

    6.169.3release notes

  • Test case observations now include a filename and line number for the status_reason, when known.

    6.167.0release notes

  • Values recorded with note() are now included as an ordered list of strings in each test-case observation's metadata.notes.

    6.161.0release notes

  • Adds efficient filtering that composes with consumes() in either order; filtered draws select among matching values and consume only the value actually drawn.

    6.160.0release notes

  • Adds an efficient mapping method that composes with consumes() in either order.

    6.160.0release notes

  • abi3 wheels are now published for 32-bit Linux and 32-bit Windows, making those distributions available for these platforms.

    6.156.5release notes

  • Hypothesis now publishes abi3 wheels built against the Python 3.10 stable ABI, in addition to version-specific wheels.

    6.156.4release notes

Performance 8

  • Generating unique collections, such as sets() or lists() with unique=True, is considerably more efficient because Hypothesis avoids draws that would be rejected.

    6.170.1release notes

  • Statistics summarisation no longer has quadratic-time behaviour, avoiding an apparent hang after the last test case when running under pytest with more than 100k test cases.

    6.168.3release notes

  • Rejected drawn elements are marked as discarded, allowing the shrinker to delete them wholesale and generation to avoid revisiting choices that would be rejected again.

    6.167.1release notes

  • Improves performance when one_of() can be simplified to a single real strategy, such as st.integers() | st.nothing().

    6.165.9release notes

  • Improves performance for unique collections drawn from a fixed pool of elements under symbolic-execution backends such as hypothesis-crosshair.

    6.156.8release notes

  • Shrinking large floats, strings, and bytestrings is now much faster in some cases.

    6.155.1release notes

  • from_type() resolves each type only once for hierarchies of abstract classes whose subclasses refer back to the base class in their annotations, improving performance from cubic time in the number of subclasses.

    6.153.5release notes

  • Performance improved for stateful testing of state machines with a large number of rules.

    6.153.2release notes

Behavior and default changes 20

  • Adds support for running Hypothesis on PyPy 3.12.

    6.168.4release notes

  • datetimes() now generates tricky datetimes more often, including values near offset transitions, leap seconds, and well-known dates.

    6.168.0release notes

  • The explain phase now varies interactive draws from data(), annotating freely-variable draws with a comment like @given arguments.

    6.166.0release notes

  • For max_examples budgets above 1000, optimisation starts earlier and alternates with generation while scores improve, rather than running one pass halfway through the run.

    6.165.4release notes

  • Values from specific branches of unions can now be re-encoded and shrunk as if generated by wider branches for more strategy combinations.

    6.165.2release notes

  • characters() now warns when the codec can generate characters that encode successfully but do not decode back to the same character. Use include_characters to generate them without the warning, or exclude_characters to generate only round-tripping characters.

    6.165.0release notes

  • Generated async functions follow Trio-style checkpoint semantics.

    6.164.0release notes

  • functions() generates functions of the same kind as like=, supporting async functions, generator functions, and async generator functions as well as plain functions.

    6.164.0release notes

  • pure=True is supported only for plain functions.

    6.164.0release notes

  • Generated generator functions yield values drawn from returns; return-type annotations such as Iterator[int] or AsyncIterator[int] can infer the returns strategy.

    6.164.0release notes

  • Constants collection now also collects the float components of complex literals like "3.5j".

    6.163.1release notes

  • The vendored top-level-domain list used by the provisional domains() strategy was updated.

    6.161.7release notes

  • When the returns= strategy can produce only one value, generated functions are displayed as a constant lambda instead of listing each call separately.

    6.161.6release notes

  • Accepts timezone-aware min_value and max_value bounds, treated as moments in time; timezones defaults to timezones(), and mixing an aware and naive bound raises an error.

    6.158.0release notes

  • When annotated-types has been imported, overloaded type hints distinguish naive from aware datetimes using Timezone metadata.

    6.158.0release notes

  • Now supports the annotated-types Timezone constraint on datetime and time.

    6.157.0release notes

  • Under symbolic backends, observability output now displays arguments generated by data as data(...).

    6.156.9release notes

  • from_dtype() supports numpy.dtypes.StringDType and generates arbitrary strings via text().

    6.155.0release notes

  • The mapping and optional arguments can have different key and value types, which are unioned in the inferred result.

    6.154.2release notes

  • The error message now describes what differed between generation runs and the strategy stack; in stateful tests, it also reports the steps leading up to the error.

    6.152.12release notes

Tooling 7

  • The conformance test can test providers with required constructor arguments, runs many test cases per provider, treats entropy exhaustion as expected control flow, and checks that providers generate a representative range of values.

    6.170.0release notes

  • abi3 wheels are now published for Linux s390x (manylinux) and Linux i686 (musllinux), making those platform-specific wheels available to developers.

    6.168.1release notes

  • abi3 wheels are now published for Linux armv7l on both manylinux and musllinux.

    6.161.4release notes

  • Hypothesis publishes native wheels for a range of Python versions and platforms, allowing installation without building from source.

    6.156.0release notes

  • Hypothesis publishes wheels for Pyodide on wasm32-unknown-emscripten for Python 3.13.

    6.156.0release notes

  • Its type annotations now accept a Mapping instead of requiring an invariant dict, allowing type-checkers to infer generated types for heterogeneous strategies.

    6.154.2release notes

  • The canonical git tag scheme changed from hypothesis-python-X.Y.Z to vX.Y.Z; distributions and build scripts relying on the old scheme should update.

    6.152.10release notes

Fixes and other changes 45

  • Integer draws can now generate negative values, and string draws from an empty alphabet return the empty string instead of consuming the whole buffer.

    6.170.0release notes

  • Verbose output for stateful tests now reads "Test case: <state machine>" rather than trailing off after the colon.

    6.170.0release notes

  • Fixes an error on Python 3.14 when applying @given with explicit strategies to functions whose annotations refer to types available only during type checking.

    6.169.4release notes

  • Ghostwriter now raises a helpful error for functions with no arguments instead of writing a test with an invalid empty @given() decorator.

    6.169.2release notes

  • Calling .map() or .flatmap() on data() with a keyword argument now raises the intended unsupported-operation error instead of a generic unexpected-keyword error.

    6.169.1release notes

  • Corrects the type annotation to indicate that from_field() returns a strategy for values of the field, not instances of the field type.

    6.168.5release notes

  • Writes to the cache of constants collected from local source files are now atomic, preventing concurrent processes from reading partially written files and silently changing data generated for a given seed.

    6.168.2release notes

  • An error during an internal cache update no longer leaves the cache corrupted.

    6.168.0release notes

  • Test cases that exceed the maximum allowed size now report a nonempty status_reason.

    6.167.0release notes

  • Failing cases found when possible inputs were fully enumerated now run the shrink and explain phases.

    6.166.0release notes

  • The explain phase now reports that commented parts can be varied together when the failing example ends with an uncommented part.

    6.166.0release notes

  • Fixes the shrink pass's type check, preventing incorrect handling of float precision loss above MAX_PRECISE_INTEGER.

    6.165.11release notes

  • Character classes combining a negative category with other members now match the union of their members.

    6.165.10release notes

  • Subpatterns that cannot be generated from the alphabet no longer raise an error when they may be repeated zero times.

    6.165.10release notes

  • Patterns compiled with re.ASCII now handle inverted categories, explicit characters and ranges, and casefolding correctly.

    6.165.10release notes

  • Provides a better error message when the passed pattern and alphabet are incompatible.

    6.165.8release notes

  • from_type() can now resolve the new sentinel builtin.

    6.165.7release notes

  • Hypothesis adds support for Python 3.15.

    6.165.7release notes

  • abi3 wheels are now published for Windows arm64 and Linux ppc64le (manylinux and musllinux), making these distributions available for installation on those platforms.

    6.165.6release notes

  • Fixes float generation so negative floats can be produced for a 65-bit float index format.

    6.165.3release notes

  • The explain phase no longer reports lines inside the standard library, avoiding misleading explanations.

    6.163.1release notes

  • The alphabet argument now accepts any collection of length-one strings, including tuples and lists of characters, matching the existing behavior of text().

    6.163.0release notes

  • Objects' _repr_pretty_() methods are respected in additional places, including the arguments of a failing example.

    6.161.6release notes

  • Fixes lambda display so it no longer shows the definition of an unrelated lambda with the same arguments, such as a function generated by functions() in a failing example.

    6.161.5release notes

  • Hypothesis now publishes abi3 wheels for Linux riscv64 with both manylinux and musllinux tags, enabling wheel installation on those platforms.

    6.161.2release notes

  • Terminal strategies now generate only strings that the lexer matches in their entirety, avoiding strings that fail to parse.

    6.161.1release notes

  • User-facing documentation, log messages, and error messages now call a single execution a “test case” instead of an “example”; some observability fields may change format.

    6.159.0release notes

  • Simple comparison filters are rewritten into efficient bounds, including bounds inferred from annotated types; contradictory filters produce an empty strategy instead of failing health checks.

    6.158.1release notes

  • Simple comparison filters are rewritten into efficient bounds, including bounds inferred from annotated types; contradictory filters produce an empty strategy instead of failing health checks.

    6.158.1release notes

  • Now resolves the typing-extensions TypeAliasType backport as well as the native form from Python 3.12+.

    6.157.0release notes

  • Suggests subscripting generic aliases such as annotated_types.LowerCase when they are mistakenly passed as Annotated metadata.

    6.157.0release notes

  • Calling flatmap on a consumes() bundle no longer raises an error.

    6.156.7release notes

  • Fixes artifact downloads failing because of a colliding Authorization header.

    6.156.6release notes

  • Source distributions are now uploaded to PyPI, allowing developers to obtain the package in source-distribution form.

    6.156.3release notes

  • Fixes a KeyError when reading artifacts whose zip files contain no explicit directory entries, including zips produced by actions/upload-artifact.

    6.156.2release notes

  • Concurrent use of the same strategy instance no longer errors in rare cases due to a thread-safety bug.

    6.155.7release notes

  • Rewriting a dates filter no longer triggers a stray print().

    6.155.4release notes

  • Hypothesis no longer emits a test_case observation when an alternative backend aborts an iteration with BackendCannotProceed before the test body runs, preventing spurious passed observations.

    6.155.3release notes

  • Fixes from_type() resolution to defer recursive forward references eagerly, avoiding recursion-limit failures and using a small, constant amount of stack.

    6.154.1release notes

  • The report now accounts for the Phase.explain phase separately instead of including its runtime and test cases in the Phase.shrink phase.

    6.153.6release notes

  • fuzz_one_input now tracks interesting_origin, so the database saves the smallest example of each distinct failure and observability reports include the origin.

    6.153.4release notes

  • Fixes decimals() generating values outside min_value and max_value when those bounds have more fractional digits than places.

    6.153.3release notes

  • Fixes incorrect git patch files when a file does not have a trailing newline.

    6.153.1release notes

  • event()'s payload is now typed as accepting Any, matching its runtime behavior of accepting any string-coercible object.

    6.153.0release notes

  • from_type() now resolves recursive forward references by looking them up in the caller's namespace, including references inside type[...].

    6.152.11release notes