thanks for the clear and concise write-up. I suggest adding/mentioning hypothesis [1] in the advanced unittesting section.
Hypothesis is a library designed to generate arbitrary non-random input for tests, and works well together with pytest. It greatly helps to find edge cases in your code, and helps you avoid cases where your code works for the tests and use-cases /you/ thought of, but not the uncommon cases you forgot (e.g. nan, inf, multibyte unicode, ...). It's helped me find dozens of sneaky bugs that I would've otherwise missed. Their sales pitch is better than mine though, and I suggest having a look at their documentation for better examples.
Hi all,
thanks for the clear and concise write-up. I suggest adding/mentioning hypothesis [1] in the advanced unittesting section. Hypothesis is a library designed to generate arbitrary non-random input for tests, and works well together with pytest. It greatly helps to find edge cases in your code, and helps you avoid cases where your code works for the tests and use-cases /you/ thought of, but not the uncommon cases you forgot (e.g.
nan
,inf
, multibyte unicode, ...). It's helped me find dozens of sneaky bugs that I would've otherwise missed. Their sales pitch is better than mine though, and I suggest having a look at their documentation for better examples.[1] https://github.com/HypothesisWorks/hypothesis
Related: #46