Property-based testing with Hypothesis
Channel: PyCon South Africa
Date: 13/10/2016

Jeremy Thurgood
Jeremy Thurgood http://www.pyvideo.org/video/3934/property-based-testing-with-hypothesis https://2015.za.pycon.org/talks/8/ Unit testing can be more effective and less tedious when you have an army of robot monkeys at your disposal. Why should humans have to worry about finding the particular combination of Turkish and Tengwar that crashes the serialiser, or the convoluted sequence of operations that corrupts the database? &gt; Hypothesis is a Python library for turning unit tests into generative tests, &gt; covering a far wider range of cases than you can manually. Rather than just &gt; testing for the things you already know about, Hypothesis goes out and &gt; actively hunts for bugs in your code. It usually finds them, and when it &gt; does it gives you simple and easy to read examples to demonstrate. &gt; &gt; -- Hypothesis 1.0 release announcement Property-based testing lets you think about your tests in terms of general behaviour and invariant properties instead of getting lost in the details of individual examples, and good tools (such as Hypothesis) will explore quite complex combinations of test data and reduce them to minimum failing cases. This talk will provide a practical introduction to property-based testing with Hypothesis, and show how you can use it to build more effective test suites with less effort.