If you want to test some properties or assumptions, it can be cumbersome to write a wide range of scenarios.
To automatically run your tests against a wide range of scenarios and find edge cases in your code that you would otherwise have missed, use hypothesis.
In the code above, I test if the addition of two floats is commutative. The test fails when either x or y is NaN. Now I can rewrite my code to make it more robust against these edge cases.
Learn more about hypothesis here.