You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/CLAUDE.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,16 +27,19 @@ Run tests using the build system:
27
27
28
28
## Changelog & Pull Requests
29
29
30
-
When creating a PR:
30
+
When creating a PR that changes `hypothesis-python/src/`:
31
31
1. Create `hypothesis-python/RELEASE.rst` with `RELEASE_TYPE: patch` (bugfixes) or `minor` (features)
32
32
2. See `RELEASE-sample.rst` for examples
33
33
3.**Imitate the style in `changelog.rst`** for consistency
34
34
4. Follow all changelog instructions in `CONTRIBUTING.rst`
35
35
36
+
**Note:** Test-only changes (no modifications to `src/`) do not require a RELEASE.rst file.
37
+
36
38
## Before Committing
37
39
38
40
1. Do a final edit pass on all code to ensure it is:
39
41
-**Concise** - remove unnecessary verbosity
40
42
-**Idiomatic** - follows Python and Hypothesis conventions
41
43
-**Minimally commented** - code should be self-documenting; only add comments where truly needed
42
44
2.**Run `./build.sh format; ./build.sh lint`** immediately before committing to auto-format and lint code
45
+
3.**Do not reference issues or PRs in commit messages** (e.g., avoid `Fixes #1234` or `See #5678`) - this clutters the issue timeline with unnecessary links
Copy file name to clipboardExpand all lines: hypothesis-python/docs/changelog.rst
+128-4Lines changed: 128 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,130 @@ Hypothesis 6.x
18
18
19
19
.. include:: ../RELEASE.rst
20
20
21
+
.. _v6.149.0:
22
+
23
+
--------------------
24
+
6.149.0 - 2026-01-05
25
+
--------------------
26
+
27
+
This release extends the explain-phase ``# or any other generated value`` comments
28
+
to sub-arguments within :func:`~hypothesis.strategies.builds`,
29
+
:func:`~hypothesis.strategies.tuples`, and :func:`~hypothesis.strategies.fixed_dictionaries`.
30
+
31
+
Previously, these comments only appeared on top-level test arguments. Now, when
32
+
the explain phase determines that a sub-argument can vary freely without affecting
33
+
the test failure, you'll see comments like::
34
+
35
+
Falsifying example: test_foo(
36
+
obj=MyClass(
37
+
x=0, # or any other generated value
38
+
y=True,
39
+
),
40
+
data=(
41
+
'', # or any other generated value
42
+
42,
43
+
),
44
+
)
45
+
46
+
This makes it easier to understand which parts of complex inputs actually matter
47
+
for reproducing a failure.
48
+
49
+
.. _v6.148.13:
50
+
51
+
---------------------
52
+
6.148.13 - 2026-01-05
53
+
---------------------
54
+
55
+
Clean up an internal helper.
56
+
57
+
.. _v6.148.12:
58
+
59
+
---------------------
60
+
6.148.12 - 2026-01-04
61
+
---------------------
62
+
63
+
This patch fixes :func:`~hypothesis.strategies.from_type` to properly handle
64
+
parameterized type aliases created with Python 3.12+'s :pep:`695` ``type``
65
+
statement. For example, ``st.from_type(A[int])`` where ``type A[T] = list[T]``
66
+
now correctly resolves to ``lists(integers())`` instead of raising a
67
+
``TypeError`` (:issue:`4628`).
68
+
69
+
.. _v6.148.11:
70
+
71
+
---------------------
72
+
6.148.11 - 2026-01-03
73
+
---------------------
74
+
75
+
Hypothesis now prints a |Verbosity.verbose| log when we switch away from an :ref:`alternative backend <alternative-backends>`.
76
+
77
+
.. _v6.148.10:
78
+
79
+
---------------------
80
+
6.148.10 - 2026-01-03
81
+
---------------------
82
+
83
+
Fixes :ref:`Ghostwriter <ghostwriter>` output for :pypi:`numpy` >= 2.4.0. Also adds support |st.from_type| for :pypi:`numpy` 2.5.0 nightly (which has not yet been released).
84
+
85
+
.. _v6.148.9:
86
+
87
+
--------------------
88
+
6.148.9 - 2026-01-01
89
+
--------------------
90
+
91
+
|.example| no longer emits |NonInteractiveExampleWarning| when running a python file directly. This means that e.g. ``python my_sandbox.py`` during exploratory work with |.example| will no longer raise warnings.
92
+
93
+
.. _v6.148.8:
94
+
95
+
--------------------
96
+
6.148.8 - 2025-12-23
97
+
--------------------
98
+
99
+
Add ``__dict__`` and ``__proto__`` to the list of constant strings Hypothesis sometimes generates.
100
+
101
+
.. _v6.148.7:
102
+
103
+
--------------------
104
+
6.148.7 - 2025-12-05
105
+
--------------------
106
+
107
+
When multiple explicit |@example| decorators fail with the same error,
108
+
Hypothesis now shows only the simplest failing example (by shortlex order)
109
+
with a note about how many other examples also failed (:issue:`4520`).
110
+
111
+
To see all failing examples, use |Verbosity.verbose| or higher.
112
+
113
+
.. _v6.148.6:
114
+
115
+
--------------------
116
+
6.148.6 - 2025-12-04
117
+
--------------------
118
+
119
+
Fix a bug where we persisted symbolics from solver-based :ref:`alternative backends <alternative-backends>` in |event|.
120
+
121
+
.. _v6.148.5:
122
+
123
+
--------------------
124
+
6.148.5 - 2025-12-01
125
+
--------------------
126
+
127
+
This patch improves the error message for :class:`~hypothesis.errors.FlakyStrategyDefinition`
128
+
when the precondition for a rule is flaky (:issue:`4206`).
129
+
130
+
.. _v6.148.4:
131
+
132
+
--------------------
133
+
6.148.4 - 2025-12-01
134
+
--------------------
135
+
136
+
This patch improves the type annotations for :func:`~hypothesis.extra.numpy.basic_indices`.
137
+
The return type now accurately reflects the ``allow_ellipsis`` and ``allow_newaxis``
138
+
parameters, excluding ``EllipsisType`` or ``None`` from the union when those index
139
+
types are disabled (:issue:`4607`).
140
+
141
+
Additionally, :func:`~hypothesis.assume` now has overloaded type annotations:
142
+
``assume(True)`` returns ``Literal[True]``, while ``assume(False)`` and
143
+
``assume(None)`` return ``NoReturn``.
144
+
21
145
.. _v6.148.3:
22
146
23
147
--------------------
@@ -2700,7 +2824,7 @@ This patch fixes a significant slowdown when using the :func:`~hypothesis.statef
2700
2824
6.100.2 - 2024-04-28
2701
2825
--------------------
2702
2826
2703
-
Explicitly cast :obj:`numpy.finfo.smallest_normal` to builtin `float` in
2827
+
Explicitly cast :obj:`numpy.finfo.smallest_normal <numpy.finfo>` to builtin `float` in
2704
2828
preparation for the :pypi:`numpy==2.0 <numpy>` release (:issue:`3950`)
2705
2829
2706
2830
.. _v6.100.1:
@@ -4287,7 +4411,7 @@ Thanks to Felix Divo for the new feature!
4287
4411
-------------------
4288
4412
4289
4413
This patch fixes invalid annotations detected for the tests generated by
4290
-
:ref:`Ghostwritter <ghostwriter>`. It will now correctly generate ``Optional``
4414
+
:ref:`Ghostwriter <ghostwriter>`. It will now correctly generate ``Optional``
4291
4415
types with just one type argument and handle union expressions inside of type
4292
4416
arguments correctly. Additionally, it now supports code with the
4293
4417
``from __future__ import annotations`` marker for Python 3.10 and newer.
@@ -4321,7 +4445,7 @@ For now, we capture calls made via :func:`~hypothesis.strategies.builds`, and vi
4321
4445
6.64.0 - 2023-01-23
4322
4446
-------------------
4323
4447
4324
-
The :ref:`Ghostwritter <ghostwriter>` will now include type annotations on tests
4448
+
The :ref:`Ghostwriter <ghostwriter>` will now include type annotations on tests
4325
4449
for type-annotated code. If you want to force this to happen (or not happen),
4326
4450
pass a boolean to the new ``annotate=`` argument to the Python functions, or
4327
4451
the ``--[no-]annotate`` CLI flag.
@@ -4864,7 +4988,7 @@ This PR was kindly supported by `Ordina Pythoneers
4864
4988
6.47.0 - 2022-06-07
4865
4989
-------------------
4866
4990
4867
-
The :ref:`Ghostwritter <ghostwriter>` can now write tests for
4991
+
The :ref:`Ghostwriter <ghostwriter>` can now write tests for
4868
4992
:obj:`@classmethod <classmethod>` or :obj:`@staticmethod <staticmethod>`
4869
4993
methods, in addition to the existing support for functions and other callables
4870
4994
(:issue:`3318`). Thanks to Cheuk Ting Ho for the patch.
Copy file name to clipboardExpand all lines: hypothesis-python/docs/tutorial/custom-strategies.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ Let's see this new strategy in action:
58
58
59
59
.. note::
60
60
61
-
Just like all other strategies, we called ``sums_to_one`` before passing it to |@given|. |st.composite| should be thought of as turning its decorated function into a function which returns a stratgy when called. This is actually the same as existing strategies in Hypothesis; |st.integers| is really a function, which returns a strategy for integers when called.
61
+
Just like all other strategies, we called ``sums_to_one`` before passing it to |@given|. |st.composite| should be thought of as turning its decorated function into a function which returns a strategy when called. This is actually the same as existing strategies in Hypothesis; |st.integers| is really a function, which returns a strategy for integers when called.
0 commit comments