Hypothesis Testing with Oracle Functions

1 · Hillel Wayne · July 21, 2017, 2 p.m.
This post is about the Hypothesis testing library. If you’re unfamiliar with it, check it out! Property tests are a fantastic addition to your testing suite. All examples use pytest. Imagine we’ve written a bubblesort: def bubblesort(l: List[int]) -> List[int]: # blah blah blah What are some of the properties we could test? We could check that the input has the same length as the output: from hypothesis import given from hypothesis....