-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
After months of using pytest
, I only recently learned the existence of pytest.approx()
through the Scientific Python Development Guide. Knowing this beforehand would have spared me a lot of ugly assert np.isallclose(a,b)
. I don't think me not knowing about the existence of this function beforehand is my fault because I read the Get Started, How to write and report assertions in tests, and How to use fixtures pages, which I feel like should be enough to start writing tests and have a general idea of what the package is capable of.
Since so many people use Python for scientific computing, I reckon it would be good to at least mention the existence of pytest.approx()
in the "How to write and report assertions in tests" guide. Honestly, the fact that it works so well with numpy arrays, even those including NaN
s, makes this function a selling point of pytest
in my books, so I would argue it could even be included in the "Get Started" page.
If you agree with me that a reference to pytest.approx()
should be added to the "How to write and report assertions" guide and/or the "Get Started" page (and you tell me which of these 2 pages should be modified), I'd be more than happy to change the doc myself.
What do you all think about it?