Hypothesis tries to detect common mistakes and things that will cause difficulty at run time in the form of a number of ‘health checks’.
These include detecting and warning about:
- Strategies with very slow data generation
- Strategies which filter out too much
- Recursive strategies which branch too much
- Tests that are unlikely to complete in a reasonable amount of time.
If any of these scenarios are detected, Hypothesis will emit a warning about them.
The general goal of these health checks is to warn you about things that you are doing that might appear to work but will either cause Hypothesis to not work correctly or to perform badly.
To selectively disable health checks, use the
The argument for this parameter is a list with elements drawn from any of
the class-level attributes of the HealthCheck class.
Using a value of
HealthCheck.all() will disable all health checks.
Each member of this enum is a type of health check to suppress.
Deprecated and no longer does anything. It used to convert errors in data generation into FailedHealthCheck error.
Check for when the typical size of the examples you are generating exceeds the maximum allowed size too often.
Check for when your data generation is extremely slow and likely to hurt testing.
Deprecated and no longer does anything. It used to check for whether your tests used the global random module. Now @given tests automatically seed random so this is no longer an error.
Checks if your tests return a non-None value (which will be ignored and is unlikely to do what you want).
Checks if your tests have been running for a very long time.
Checks if the natural example to shrink towards is very large.
Checks if @given has been applied to a method of unittest.TestCase.