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

Function test_string_comparisons_empty

numpy/core/tests/test_strings.py:78–85  ·  view source on GitHub ↗
(op, ufunc, sym, dtypes)

Source from the content-addressed store, hash-verified

76@pytest.mark.parametrize("dtypes", [
77 ("S2", "S2"), ("S2", "S10"), ("<U1", "<U1"), ("<U1", ">U10")])
78def test_string_comparisons_empty(op, ufunc, sym, dtypes):
79 arr = np.empty((1, 0, 1, 5), dtype=dtypes[0])
80 arr2 = np.empty((100, 1, 0, 1), dtype=dtypes[1])
81
82 expected = np.empty(np.broadcast_shapes(arr.shape, arr2.shape), dtype=bool)
83 assert_array_equal(op(arr, arr2), expected)
84 assert_array_equal(ufunc(arr, arr2), expected)
85 assert_array_equal(np.compare_chararrays(arr, arr2, sym, False), expected)
86
87
88@pytest.mark.parametrize("str_dt", ["S", "U"])

Callers

nothing calls this directly

Calls 2

assert_array_equalFunction · 0.90
ufuncClass · 0.85

Tested by

no test coverage detected