hypothesis
Installation
SKILL.md
Hypothesis — Property-based testing for Python
Overview
An ordinary test checks a few hand-picked inputs. A Hypothesis test describes the inputs with a strategy and asserts something that must be true for every one of them. Hypothesis runs the test 100 times by default with generated values, remembers failures, and shrinks a failing input to a minimal one. It fits pure functions, parsers, serializers, money and date arithmetic, and any code with an invariant that can be written down.
Instructions
Installation
pip install hypothesis pytest
pip install "hypothesis[cli]" # adds the `hypothesis` command, including `hypothesis write`
Integrations come as extras with their own dependencies, among them numpy, pandas, django, dateutil, pytz, lark, redis and codemods: for example pip install "hypothesis[numpy]".