(self)
| 839 | op(1, approx(1, rel=1e-6, abs=1e-12)) |
| 840 | |
| 841 | def test_numpy_array_with_scalar(self): |
| 842 | np = pytest.importorskip("numpy") |
| 843 | |
| 844 | actual = np.array([1 + 1e-7, 1 - 1e-8]) |
| 845 | expected = 1.0 |
| 846 | |
| 847 | assert actual == approx(expected, rel=5e-7, abs=0) |
| 848 | assert actual != approx(expected, rel=5e-8, abs=0) |
| 849 | assert approx(expected, rel=5e-7, abs=0) == actual |
| 850 | assert approx(expected, rel=5e-8, abs=0) != actual |
| 851 | |
| 852 | def test_numpy_scalar_with_array(self): |
| 853 | np = pytest.importorskip("numpy") |