mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-07 16:25:12 +00:00
Add const T to docstring generation. (#3020)
* Add const T to docstring generation. * Change order. * See if existing test triggers for a const type. * Add tests. * Fix test. * Remove experiment. * Reformat. * More tests, checks run. * Adding `test_fmt_desc_` prefix to new test functions. * Using pytest.mark.parametrize to 1. condense test; 2. exercise all functions even if one fails; 3. be less platform-specific (e.g. C++ float is not necessarily float32). Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
This commit is contained in:
@@ -482,6 +482,19 @@ def test_index_using_ellipsis():
|
||||
assert a.shape == (6,)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"test_func",
|
||||
[
|
||||
m.test_fmt_desc_float,
|
||||
m.test_fmt_desc_double,
|
||||
m.test_fmt_desc_const_float,
|
||||
m.test_fmt_desc_const_double,
|
||||
],
|
||||
)
|
||||
def test_format_descriptors_for_floating_point_types(test_func):
|
||||
assert "numpy.ndarray[numpy.float" in test_func.__doc__
|
||||
|
||||
|
||||
@pytest.mark.parametrize("forcecast", [False, True])
|
||||
@pytest.mark.parametrize("contiguity", [None, "C", "F"])
|
||||
@pytest.mark.parametrize("noconvert", [False, True])
|
||||
|
||||
Reference in New Issue
Block a user