-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
type: bugproblem that needs to be addressedproblem that needs to be addressed
Description
This works:
>>> import pytest
>>> pytest.approx(5.)
5.0 ± 5.0e-06
This doesn't work:
>>> import pytest; import numpy as np
>>> pytest.approx(np.array(5.))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/_pytest/python_api.py", line 83, in __repr__
self._approx_scalar(x) for x in np.asarray(self.expected)))
TypeError: iteration over a 0-d array
This looks like a bug to me.
pytest 3.6.0
numpy 1.14.3
Thanks, Florian
Metadata
Metadata
Assignees
Labels
type: bugproblem that needs to be addressedproblem that needs to be addressed