(self)
| 682 | assert op(a, approx(np.array(x), nan_ok=True)) |
| 683 | |
| 684 | def test_numpy_expecting_inf(self): |
| 685 | np = pytest.importorskip("numpy") |
| 686 | examples = [ |
| 687 | (eq, inf, inf), |
| 688 | (eq, -inf, -inf), |
| 689 | (ne, inf, -inf), |
| 690 | (ne, 0.0, inf), |
| 691 | (ne, nan, inf), |
| 692 | ] |
| 693 | for op, a, x in examples: |
| 694 | assert op(np.array(a), approx(x)) |
| 695 | assert op(a, approx(np.array(x))) |
| 696 | assert op(np.array(a), approx(np.array(x))) |
| 697 | |
| 698 | def test_numpy_array_wrong_shape(self): |
| 699 | np = pytest.importorskip("numpy") |