MCPcopy Create free account
hub / github.com/numpy/numpy / test_single_value

Method test_single_value

numpy/lib/tests/test_arraypad.py:33–44  ·  view source on GitHub ↗

Test casting for a single value.

(self)

Source from the content-addressed store, hash-verified

31
32class TestAsPairs:
33 def test_single_value(self):
34 """Test casting for a single value."""
35 expected = np.array([[3, 3]] * 10)
36 for x in (3, [3], [[3]]):
37 result = _as_pairs(x, 10)
38 assert_equal(result, expected)
39 # Test with dtype=object
40 obj = object()
41 assert_equal(
42 _as_pairs(obj, 10),
43 np.array([[obj, obj]] * 10)
44 )
45
46 def test_two_values(self):
47 """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