Contribute Media
A thank you to everyone who makes this possible: Read More

More testing with fewer tests

Translations: en

Description

Clinton Roy https://2016.pycon-au.org/schedule/188/view_talk We all wish we were were testing more, but tests are ugly, a pain to write and are brittle. Property based testing helps to solve all of these problems. Now, with Hypothesis, Python has an outstanding toolkit to write property based tests.

With Hypothesis, instead of writing individual tests, you describe properties of your code and Hypothesis generates the test cases for you. This frees you from writing repetitive and error prone test cases. Hypothesis will generate many more test cases than you'll ever be able to bare writing, and will find more bugs.

Hypothesis has plugins for Django and numpy to help you generate test cases for these two frameworks.

Details

Improve this page