MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_expecting_nan

Method test_expecting_nan

testing/python/approx.py:490–503  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

488 assert op(a, approx(x))
489
490 def test_expecting_nan(self):
491 examples = [
492 (eq, nan, nan),
493 (eq, -nan, -nan),
494 (eq, nan, -nan),
495 (ne, 0.0, nan),
496 (ne, inf, nan),
497 ]
498 for op, a, x in examples:
499 # Nothing is equal to NaN by default.
500 assert a != approx(x)
501
502 # If ``nan_ok=True``, then NaN is equal to NaN.
503 assert op(a, approx(x, nan_ok=True))
504
505 def test_int(self):
506 within_1e6 = [(1000001, 1000000), (-1000001, -1000000)]

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected