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

Method test_single_value

numpy/lib/tests/test_arraypad.py:32–43  ·  view source on GitHub ↗

Test casting for a single value.

(self)

Source from the content-addressed store, hash-verified

30
31class TestAsPairs:
32 def test_single_value(self):
33 """Test casting for a single value."""
34 expected = np.array([[3, 3]] * 10)
35 for x in (3, [3], [[3]]):
36 result = _as_pairs(x, 10)
37 assert_equal(result, expected)
38 # Test with dtype=object
39 obj = object()
40 assert_equal(
41 _as_pairs(obj, 10),
42 np.array([[obj, obj]] * 10)
43 )
44
45 def test_two_values(self):
46 """Test proper casting for two different values."""

Callers

nothing calls this directly

Calls 2

_as_pairsFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected