Hypothesis: Simpler Powerful Test Cases
summary
Property-based testing using Hypothesis for Python with works with pytest and unittest and a simple pip install workflow. Write properties (given, assume) and Hypothesis generates up to ~2000 cases, finds surprising failures (double-negation breaks on None and certain floats), finds minimal counterexamples by shrinking to the simplest failing input, and caches failures for replay. It supplies strategies for ints, floats, text, dates, lists, recursive structures, building objects and stateful tests so complex scenarios are generated and reproduced.
AI-written summary · about
chapters (9)
- 0:00Introduction and background
- 2:02Introduction to hypothesis
- 4:52Basic testing strategies
- 8:25Data generation features
- 12:14Working with complex types
- 14:26Advanced data generation
- 18:11Caching and stateful testing
- 20:48Live code demonstration
- 24:07Questions and answers
related talks
41mProperty Based Testing in Python with Hypothesis
27mTesting Beyond Examples: Property Based Testing with Hypothesis
26mProperty Based Testing the Python Way
50mProperty based testing with Hypothesis
41mProperty Based Testing with Hypothesis: Stronger Tests, Less Work
01h 23mIntroduction to Property-Based Testing
01h 24mIntroduction to Property Based Testing
30mStop Writing Tests!
