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

Method test_numpy_array_with_scalar

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected