~/talk

Testing Beyond Examples: Property Based Testing with Hypothesis

Talkat PyCon AU 2026 · 2026-08-26..08-30· [testing, python]
links:none on file
slides:none on file

Introduces concrete use of Hypothesis: property rules instead of examples, defaulting to 100 generated cases and able to run 10,000+ deep CI runs; shows real fixes (split-bill off-by-one cents, cart negative total) found by state-machine and round‑trip tests, shrinking to minimal failing sequences, reproducible seeds and a failure database. Covers useful properties (roundtrip, invariants, fast‑path equivalence), strategy composition and pitfalls (don’t reimplement the function in the test, avoid overusing assume), and how to incrementally add Hypothesis to pytest.

AI-written summary · about

  1. 0:00Property based testing intro
  2. 1:57What PBT solves
  3. 3:00Finding edge cases
  4. 4:23Where PBT shines
  5. 6:31Reproducibility and shrinking
  6. 7:32Built-in input strategies
  7. 9:59First Hypothesis test
  8. 12:03Split bill function example
  9. 13:51State machine testing
  10. 16:59Good property traits
  11. 19:05Common patterns for property based tests
  12. 20:29PBT mistakes to avoid
  13. 22:38Start using Hypothesis
  14. 23:41Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.