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

Method test_numpy_expecting_inf

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

Source from the content-addressed store, hash-verified

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")

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected