Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Broken output when a multidimensional NumPy array fails to be approximate something #3712
Consider the following example comparing two multidimensional arrays using approx:
from pytest import approx import numpy as np def test_something(): shape = (5,4) X = np.ones(shape) Y = np.ones(shape)*2 assert X==approx(Y)
The error thrown by PyTest is:
This is confusing since at first glance it seems that the problem is that I tried to convert some array in an inappropriate manner, while actually the assertion failed.
My PyTest version is 3.3.2.