We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 762eaf4 commit 535fd1fCopy full SHA for 535fd1f
testing/python/approx.py
@@ -390,6 +390,20 @@ def test_numpy_expecting_nan(self):
390
assert op(np.array(a), approx(x, nan_ok=True))
391
assert op(a, approx(np.array(x), nan_ok=True))
392
393
+ def test_numpy_expecting_inf(self):
394
+ np = pytest.importorskip("numpy")
395
+ examples = [
396
+ (eq, inf, inf),
397
+ (eq, -inf, -inf),
398
+ (ne, inf, -inf),
399
+ (ne, 0.0, inf),
400
+ (ne, nan, inf),
401
+ ]
402
+ for op, a, x in examples:
403
+ assert op(np.array(a), approx(x))
404
+ assert op(a, approx(np.array(x)))
405
+ assert op(np.array(a), approx(np.array(x)))
406
+
407
def test_numpy_array_wrong_shape(self):
408
np = pytest.importorskip("numpy")
409
0 commit comments