-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
topic: approxrelated to pytest.approx functionrelated to pytest.approx functiontype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
Description
Via #8335 (comment), this issue proposes that we should deprecate pytest.approx()
for numpy.ndarray
s 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 🙂
RonnyPfannschmidt and tarcisiofischer
Metadata
Metadata
Assignees
Labels
topic: approxrelated to pytest.approx functionrelated to pytest.approx functiontype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature