Skip to content

Commit 888a373

Browse files
committed
Merge remote-tracking branch 'upstream/master' into more-constant-strings
2 parents 458eb1b + 4939dab commit 888a373

46 files changed

Lines changed: 1412 additions & 1894 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ jobs:
254254
# Note that the versions below are updated by `update_pyodide_versions()` in our weekly cronjob.
255255
# The versions of pyodide-build and the Pyodide runtime may differ.
256256
PYODIDE_VERSION: 0.29.3
257-
PYODIDE_BUILD_VERSION: 0.32.0
257+
PYODIDE_BUILD_VERSION: 0.34.1
258258
# pyodide 0.29.0 (latest at time of writing) doesn't yet support 3.14
259259
PYTHON_VERSION: 3.13.2
260260
steps:
@@ -278,7 +278,7 @@ jobs:
278278
run: |
279279
pip install --upgrade setuptools pip wheel build
280280
python -m build --wheel hypothesis-python --outdir dist/
281-
pip download --dest=dist/ hypothesis-python/ pytest tzdata # fetch all the wheels
281+
pip download --dest=dist/ hypothesis-python/ pytest tzdata syrupy # fetch all the wheels
282282
rm dist/packaging-*.whl # fails with `invalid metadata entry 'name'`
283283
pyodide venv .venv-pyodide
284284
source .venv-pyodide/bin/activate

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ SCRIPTS="$ROOT/tooling/scripts"
1919
# shellcheck source=tooling/scripts/common.sh
2020
source "$SCRIPTS/common.sh"
2121

22-
PYTHON_VERSION="3.14.3"
22+
PYTHON_VERSION="3.14.4"
2323

2424
if [ -n "${GITHUB_ACTIONS-}" ] || [ -n "${CODESPACES-}" ] || [ -n "${CLAUDECODE-}" ] ; then
2525
# We're on GitHub Actions, Codespaces, or Claude Code and already have a suitable Python

hypothesis-python/docs/changelog.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,53 @@ Hypothesis 6.x
1818

1919
.. include:: ../RELEASE.rst
2020

21+
.. _v6.151.13:
22+
23+
---------------------
24+
6.151.13 - 2026-04-13
25+
---------------------
26+
27+
This patch removes some newly unnecessary ``# type: ignore`` comments.
28+
29+
.. _v6.151.12:
30+
31+
---------------------
32+
6.151.12 - 2026-04-08
33+
---------------------
34+
35+
This release improves |Phase.explain| output by excluding pytest-related :pypi:`syrupy` files as a possible source of variation.
36+
37+
.. _v6.151.11:
38+
39+
---------------------
40+
6.151.11 - 2026-04-05
41+
---------------------
42+
43+
This patch improves printing of primitive values generated from complex
44+
strategies, particularly for :func:`~hypothesis.strategies.from_regex`.
45+
Previously, these would often be printed as function calls desctribing
46+
how to construct them. Now they will always be printed as a literal value.
47+
48+
.. _v6.151.10:
49+
50+
---------------------
51+
6.151.10 - 2026-03-29
52+
---------------------
53+
54+
When shrinking takes more than five minutes, Hypothesis now prints the
55+
``@seed`` decorator alongside the slow-shrinking warning so you can
56+
reproduce the failure.
57+
58+
Thanks to Ian Hunt-Isaak for this contribution!
59+
60+
.. _v6.151.9:
61+
62+
--------------------
63+
6.151.9 - 2026-02-16
64+
--------------------
65+
66+
Remove some old unused code.
67+
2168
.. _v6.151.8:
2269

2370
--------------------

hypothesis-python/docs/community.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Hypothesis community is full of excellent people who can answer your questio
77
* You can post a question on Stack Overflow using the `python-hypothesis <https://stackoverflow.com/questions/tagged/python-hypothesis>`__ tag.
88
* We also have `a mailing list <https://groups.google.com/forum/#!forum/hypothesis-users>`_. Feel free to use it to ask for help, provide feedback, or discuss anything remotely Hypothesis related at all.
99

10-
Note that the :gh-file:`Hypothesis code of conduct <CODE_OF_CONDUCT.rst>` applies in all Hypothesis community spaces!
10+
Note that the :gh-file:`Hypothesis code of conduct <.github/CODE_OF_CONDUCT.rst>` applies in all Hypothesis community spaces!
1111

1212
If you would like to cite Hypothesis, please consider :gh-file:`our suggested citation <CITATION.cff>`.
1313

hypothesis-python/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def process_signature(app, what, name, obj, options, signature, return_annotatio
173173
intersphinx_mapping = {
174174
"python": ("https://docs.python.org/3/", None),
175175
"numpy": ("https://numpy.org/doc/stable/", None),
176-
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
176+
"pandas": ("https://pandas.pydata.org/docs/", None),
177177
"pytest": ("https://docs.pytest.org/en/stable/", None),
178178
"django": (
179179
"http://docs.djangoproject.com/en/stable/",

hypothesis-python/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ dpcontracts = ["dpcontracts>=0.4"]
116116
redis = ["redis>=3.0.0"]
117117
crosshair = ["hypothesis-crosshair>=0.0.27", "crosshair-tool>=0.0.102"]
118118
# zoneinfo is an odd one: every dependency is platform-conditional.
119-
zoneinfo = ["tzdata>=2025.3; sys_platform == 'win32' or sys_platform == 'emscripten'"]
119+
zoneinfo = ["tzdata>=2026.1; sys_platform == 'win32' or sys_platform == 'emscripten'"]
120120
# We only support Django versions with upstream support - see
121121
# https://www.djangoproject.com/download/#supported-versions
122122
# We also leave the choice of timezone library to the user, since it
123123
# might be zoneinfo or pytz depending on version and configuration.
124124
django = ["django>=4.2"]
125125
watchdog = ["watchdog>=4.0.0"]
126126
# Avoid changing this by hand. This is automatically updated by update_changelog_and_version
127-
all = ["black>=20.8b0", "click>=7.0", "crosshair-tool>=0.0.102", "django>=4.2", "dpcontracts>=0.4", "hypothesis-crosshair>=0.0.27", "lark>=0.10.1", "libcst>=0.3.16", "numpy>=1.21.6", "pandas>=1.1", "pytest>=4.6", "python-dateutil>=1.4", "pytz>=2014.1", "redis>=3.0.0", "rich>=9.0.0", "tzdata>=2025.3; sys_platform == 'win32' or sys_platform == 'emscripten'", "watchdog>=4.0.0"]
127+
all = ["black>=20.8b0", "click>=7.0", "crosshair-tool>=0.0.102", "django>=4.2", "dpcontracts>=0.4", "hypothesis-crosshair>=0.0.27", "lark>=0.10.1", "libcst>=0.3.16", "numpy>=1.21.6", "pandas>=1.1", "pytest>=4.6", "python-dateutil>=1.4", "pytz>=2014.1", "redis>=3.0.0", "rich>=9.0.0", "tzdata>=2026.1; sys_platform == 'win32' or sys_platform == 'emscripten'", "watchdog>=4.0.0"]
128128

129129
[tool.setuptools.dynamic]
130130
version = {attr = "hypothesis.version.__version__"}

hypothesis-python/src/hypothesis/core.py

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,19 +2217,37 @@ def wrapped_test(*arguments, **kwargs):
22172217
generated_seed = (
22182218
wrapped_test._hypothesis_internal_use_generated_seed
22192219
)
2220+
assert state._runner is not None
2221+
stopped_because_slow_shrinking = (
2222+
state._runner.statistics.get("stopped-because")
2223+
== "shrinking was very slow"
2224+
)
22202225
with local_settings(settings):
2221-
if not (state.failed_normally or generated_seed is None):
2222-
if running_under_pytest:
2223-
report(
2224-
f"You can add @seed({generated_seed}) to this test or "
2225-
f"run pytest with --hypothesis-seed={generated_seed} "
2226-
"to reproduce this failure."
2226+
if generated_seed is not None and (
2227+
not state.failed_normally or stopped_because_slow_shrinking
2228+
):
2229+
pytest_extra_msg = (
2230+
(
2231+
", or by running pytest with "
2232+
f"--hypothesis-seed={generated_seed}"
2233+
)
2234+
if running_under_pytest
2235+
else ""
2236+
)
2237+
if stopped_because_slow_shrinking:
2238+
msg = (
2239+
"\nThis test function exited early because"
2240+
" it took too long to shrink. If desired for debugging, "
2241+
f"you can reproduce this by adding @seed({generated_seed}) "
2242+
f"to this test{pytest_extra_msg}."
22272243
)
22282244
else:
2229-
report(
2230-
f"You can add @seed({generated_seed}) to this test to "
2231-
"reproduce this failure."
2245+
msg = (
2246+
"You can reproduce this failure by adding "
2247+
f"@seed({generated_seed}) to this test"
2248+
f"{pytest_extra_msg}."
22322249
)
2250+
report(msg)
22332251
# The dance here is to avoid showing users long tracebacks
22342252
# full of Hypothesis internals they don't care about.
22352253
# We have to do this inline, to avoid adding another

0 commit comments

Comments
 (0)