Via #8335 (comment), this issue proposes that we should deprecate pytest.approx() for numpy.ndarrays in favor of the numpy.testing module. That module is custom-built with lots of useful assertion helpers for Numpy, while pytest.approx() only incidentally copes with multi-dimensional arrays and the risk of treating arrays as truthy booleans in assertions.
I particularly like this because we can very easily check if something is an array without importing Numpy, and teaching people about the numpy.testing module is likely to lead to better tests 🙂
Via #8335 (comment), this issue proposes that we should deprecate
pytest.approx()fornumpy.ndarrays in favor of thenumpy.testingmodule. That module is custom-built with lots of useful assertion helpers for Numpy, whilepytest.approx()only incidentally copes with multi-dimensional arrays and the risk of treating arrays as truthy booleans in assertions.I particularly like this because we can very easily check if something is an array without importing Numpy, and teaching people about the
numpy.testingmodule is likely to lead to better tests 🙂