Manage health checks in centralized hypothesis settings as well
Marco Ricci

Marco Ricci commited on 2024-10-08 13:57:21
Zeige 2 geänderte Dateien mit 3 Einfügungen und 0 Löschungen.


Some of the tests that time out under coverage-based slow
instrumentation time out during the data generation phase, not the
actual test phase (i.e. trigger health check errors).  The root cause is
the same, and settings objects cannot be stacked, so amend the standard
decorator for slow `hypothesis`-based tests, instead of introducing
a new one.
... ...
@@ -1091,6 +1091,7 @@ hypothesis_settings_coverage_compatible = (
1091 1091
             if (deadline := hypothesis.settings().deadline) is not None
1092 1092
             else None
1093 1093
         ),
1094
+        suppress_health_check=(hypothesis.HealthCheck.too_slow,),
1094 1095
     )
1095 1096
     if sys.gettrace() is not None
1096 1097
     else hypothesis.settings()
... ...
@@ -88,6 +88,7 @@ def test_200_is_vault_config(test_config: tests.VaultTestConfig) -> None:
88 88
     )
89 89
 
90 90
 
91
+@tests.hypothesis_settings_coverage_compatible
91 92
 @hypothesis.given(
92 93
     test_config=tests.smudged_vault_test_config(
93 94
         config=strategies.sampled_from(tests.TEST_CONFIGS).filter(
... ...
@@ -136,6 +137,7 @@ def test_400_validate_vault_config(test_config: tests.VaultTestConfig) -> None:
136 137
             assert not exc, 'failed to validate valid example'  # noqa: PT017
137 138
 
138 139
 
140
+@tests.hypothesis_settings_coverage_compatible
139 141
 @hypothesis.given(
140 142
     test_config=tests.smudged_vault_test_config(
141 143
         config=strategies.sampled_from(tests.TEST_CONFIGS).filter(
142 144