boost-histogram icon indicating copy to clipboard operation
boost-histogram copied to clipboard

Swapped all numpy assert_allclose & assert_array_equal to pytest approx in tests

Open gohil-jay opened this issue 1 year ago • 2 comments

Addresses https://github.com/scikit-hep/boost-histogram/commit/2c81964d8f422396963fbbcaece650f5d787eefc commit further.

I realized that there are other asserts that are imported directly which I missed in previous commit, so this covers all of them.

gohil-jay avatar Aug 15 '22 21:08 gohil-jay

Why do you replace the numpy assserts with pytest.approx? The messages produced by numpy.assert_allclose etc are better than those from pytest.approx, and numpy.assert_allclose works on array-like types, too.

HDembinski avatar Aug 17 '22 09:08 HDembinski

I believe this came up while working on the comparison issue but I don't remember the exact details on why! @henryiii do you want to chime in here?

gohil-jay avatar Aug 18 '22 01:08 gohil-jay