MCPcopy Index your code
hub / github.com/numpy/numpy / test_strict

Method test_strict

numpy/testing/tests/test_utils.py:1139–1149  ·  view source on GitHub ↗

Test the behavior of the `strict` option.

(self)

Source from the content-addressed store, hash-verified

1137 self._assert_func(-ainf, x)
1138
1139 def test_strict(self):
1140 """Test the behavior of the `strict` option."""
1141 x = np.zeros(3)
1142 y = np.ones(())
1143 self._assert_func(x, y)
1144 with pytest.raises(AssertionError):
1145 self._assert_func(x, y, strict=True)
1146 y = np.broadcast_to(y, x.shape)
1147 self._assert_func(x, y)
1148 with pytest.raises(AssertionError):
1149 self._assert_func(x, y.astype(np.float32), strict=True)
1150
1151@pytest.mark.filterwarnings(
1152 "ignore:.*NumPy warning suppression and assertion utilities are deprecated"

Callers

nothing calls this directly

Calls 2

_assert_funcMethod · 0.95
astypeMethod · 0.80

Tested by

no test coverage detected