Property Based Testing in Python with Hypothesis
summary
Property based testing using Hypothesis generates hundreds of random inputs via strategies, runs them under pytest, and automatically shrinks failures to minimal counterexamples. Controls like max_examples and timeout tune effort, assume/filter trim generated data, and a local cache records failing cases (not typically committed). Stateful testing reproduces complex sequences — for example an open close lookup pattern that exposes a rare database error — demonstrating concrete bugs found and reduced to minimal repros.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 0:42About Anthony
- 7:47History of Property Based Testing
- 10:16Hypothesis
- 17:27Common Patterns
- 24:46Stateful Systems
- 31:15Questions
related talks
26mProperty Based Testing the Python Way
50mProperty based testing with Hypothesis
27mHypothesis: Simpler Powerful Test Cases
41mProperty Based Testing with Hypothesis: Stronger Tests, Less Work
27mTesting Beyond Examples: Property Based Testing with Hypothesis
40mProperty-based Thinking
01h 31mIntroduction to Property-Based Testing
01h 23mIntroduction to Property-Based Testing
