Closed as duplicate
Description
After the FreeBSD CI job was upgraded from FreeBSD 14.0 to 14.2 in gh-28328, it is showing this test failure:
self = <test_array_coercion.TestStringDiscovery object at 0x1a16d2f95dd0>
obj = 1.2
@pytest.mark.parametrize("obj",
[object(), 1.2, 10**43, None, "string"],
ids=["object", "1.2", "10**43", "None", "string"])
def test_nested_arrays_stringlength(self, obj):
length = len(str(obj))
expected = np.dtype(f"S{length}")
arr = np.array(obj, dtype="O")
> assert np.array([arr, arr], dtype="S").dtype == expected
E RuntimeWarning: invalid value encountered in cast
arr = array(1.2, dtype=object)
expected = dtype('S3')
length = 3
obj = 1.2
self = <test_array_coercion.TestStringDiscovery object at 0x1a16d2f95dd0>
../.venv/lib/python3.11/site-packages/numpy/_core/tests/test_array_coercion.py:180: RuntimeWarning
There is no other issue for a TestStringDiscovery
failure, unclear if it's due to recent changes or specific to FreeBSD 14.2. Does it look familiar to anyone?