Remove the new np.format_parser()-based test, it's much more distracting than useful.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-05-18 18:32:56 -07:00
parent 38aa697d0d
commit 7f124bb568

View File

@ -44,11 +44,7 @@ def test_format_descriptor_format(cpp_name, expected_fmts, np_array_dtype):
fmt = m.format_descriptor_format(cpp_name)
assert fmt in expected_fmts
# Everything below just documents long-standing inconsistencies.
# See also: https://github.com/pybind/pybind11/issues/1908
if np_array_dtype is not None:
# py::format_descriptor<> vs np.array:
na = np.array([], dtype=np_array_dtype)
bi = m.get_buffer_info(na)
if fmt in ("i", "q"):
@ -58,14 +54,6 @@ def test_format_descriptor_format(cpp_name, expected_fmts, np_array_dtype):
else:
assert bi.format == fmt
# py::format_descriptor<> vs np.format_parser():
fmtp = fmt[1:] if fmt.startswith("Z") else fmt
fp = np.format_parser(fmtp, [], [])
assert fp.dtype is not None
# DO NOT try to compare fp.dtype and na.dtype, unless you have a lot of
# spare time to make sense of it and possibly chime in under #1908.
def test_from_python():
with pytest.raises(RuntimeError) as excinfo: