Skip to content

Commit d4b9f9f

Browse files
authored
Merge pull request #4331 from tybug/fix-healthcheck-link
Add settings redirect and update health check link
2 parents a686be0 + 005fdc5 commit d4b9f9f

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

hypothesis-python/RELEASE.rst

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
RELEASE_TYPE: patch
2+
3+
Update the documentation link in |HealthCheck| error messages to their new location in the documentation.

hypothesis-python/docs/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"django": "reference/strategies.html#django",
5656
"numpy": "reference/strategies.html#numpy",
5757
"observability": "reference/integrations.html#observability",
58+
"settings": "reference/api.html#settings",
5859
# TODO enable when we actually rename them
5960
# "extras": "extensions.html",
6061
# "supported": "compatibility.html",

hypothesis-python/docs/redirect.html.template

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
if (redirect) {
3030
window.location.replace(redirect);
3131
} else if (window.location.hash) {
32-
window.location.replace(target + window.location.hash);
32+
// if both the requested url and the redirect target have a hash, prefer the requested url hash.
33+
// This makes a redirect config of {"settings": "api.html#settings"} redirect settings.html#health-checks
34+
// to api.html#health-checks instead of api.html#settings.
35+
window.location.replace(target.split('#')[0] + window.location.hash);
3336
} else {
3437
window.location.replace(target);
3538
}

hypothesis-python/src/hypothesis/internal/healthcheck.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ def fail_health_check(settings, message, label):
1919
if label in settings.suppress_health_check:
2020
return
2121
message += (
22-
"\nSee https://hypothesis.readthedocs.io/en/latest/health"
23-
"checks.html for more information about this. "
22+
"\nSee "
23+
"https://hypothesis.readthedocs.io/en/latest/reference/api.html#health-checks "
24+
"for more information about this. "
2425
f"If you want to disable just this health check, add {label} "
2526
"to the suppress_health_check settings for this test."
2627
)

website/content/2018-01-08-smarkets.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ hypothesis.errors.FailedHealthCheck: It looks like your strategy is filtering ou
131131
0 good ones. This will make your tests much slower, and also will probably distort the data generation quite a lot. You should adapt your strategy
132132
to filter less. This can also be caused by a low max_leaves parameter in recursive() calls.
133133
134-
See https://hypothesis.readthedocs.io/en/latest/healthchecks.html for more information about this. If you want to disable just this health check,
134+
See https://hypothesis.readthedocs.io/en/latest/reference/api.html#health-checks for more information about this. If you want to disable just this health check,
135135
add HealthCheck.filter_too_much to the suppress_health_check settings for this test.
136136
```
137137

0 commit comments

Comments
 (0)