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

Method test_check_on_scalar

numpy/ma/tests/test_core.py:2275–2289  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2273class TestFillingValues:
2274
2275 def test_check_on_scalar(self):
2276 # Test _check_fill_value set to valid and invalid values
2277 _check_fill_value = np.ma.core._check_fill_value
2278
2279 fval = _check_fill_value(0, int)
2280 assert_equal(fval, 0)
2281 fval = _check_fill_value(None, int)
2282 assert_equal(fval, default_fill_value(0))
2283
2284 fval = _check_fill_value(0, "|S3")
2285 assert_equal(fval, b"0")
2286 fval = _check_fill_value(None, "|S3")
2287 assert_equal(fval, default_fill_value(b"camelot!"))
2288 assert_raises(TypeError, _check_fill_value, 1e+20, int)
2289 assert_raises(TypeError, _check_fill_value, 'stuff', int)
2290
2291 def test_fill_value_datetime_structured(self):
2292 # gh-29818

Callers

nothing calls this directly

Calls 4

assert_equalFunction · 0.90
default_fill_valueFunction · 0.90
assert_raisesFunction · 0.90
_check_fill_valueFunction · 0.85

Tested by

no test coverage detected