MCPcopy
hub / github.com/numpy/numpy / test_kwargs

Function test_kwargs

numpy/lib/tests/test_arraypad.py:1365–1378  ·  view source on GitHub ↗

Test behavior of pad's kwargs for the given mode.

(mode)

Source from the content-addressed store, hash-verified

1363
1364@pytest.mark.parametrize("mode", _all_modes.keys())
1365def test_kwargs(mode):
1366 """Test behavior of pad's kwargs for the given mode."""
1367 allowed = _all_modes[mode]
1368 not_allowed = {}
1369 for kwargs in _all_modes.values():
1370 if kwargs != allowed:
1371 not_allowed.update(kwargs)
1372 # Test if allowed keyword arguments pass
1373 np.pad([1, 2, 3], 1, mode, **allowed)
1374 # Test if prohibited keyword arguments of other modes raise an error
1375 for key, value in not_allowed.items():
1376 match = f"unsupported keyword arguments for mode '{mode}'"
1377 with pytest.raises(ValueError, match=match):
1378 np.pad([1, 2, 3], 1, mode, **{key: value})
1379
1380
1381def test_constant_zero_default():

Callers

nothing calls this directly

Calls 3

updateMethod · 0.80
itemsMethod · 0.80
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…