|
34 | 34 | MAError, MaskError, MaskType, MaskedArray, abs, absolute, add, all,
|
35 | 35 | allclose, allequal, alltrue, angle, anom, arange, arccos, arccosh, arctan2,
|
36 | 36 | arcsin, arctan, argsort, array, asarray, choose, concatenate,
|
37 |
| - conjugate, cos, cosh, count, default_fill_value, diag, divide, empty, |
38 |
| - empty_like, equal, exp, flatten_mask, filled, fix_invalid, |
| 37 | + conjugate, cos, cosh, count, default_fill_value, diag, divide, doc_note, |
| 38 | + empty, empty_like, equal, exp, flatten_mask, filled, fix_invalid, |
39 | 39 | flatten_structured_array, fromflex, getmask, getmaskarray, greater,
|
40 | 40 | greater_equal, identity, inner, isMaskedArray, less, less_equal, log,
|
41 | 41 | log10, make_mask, make_mask_descr, mask_or, masked, masked_array,
|
@@ -5283,3 +5283,33 @@ def test_mask_shape_assignment_does_not_break_masked():
|
5283 | 5283 | b = np.ma.array(1, mask=a.mask)
|
5284 | 5284 | b.shape = (1,)
|
5285 | 5285 | assert_equal(a.mask.shape, ())
|
| 5286 | + |
| 5287 | +@pytest.mark.skipif(sys.flags.optimize > 1, |
| 5288 | + reason="no docstrings present to inspect when PYTHONOPTIMIZE/Py_OptimizeFlag > 1") |
| 5289 | +def test_doc_note(): |
| 5290 | + def method(self): |
| 5291 | + """This docstring |
| 5292 | +
|
| 5293 | + Has multiple lines |
| 5294 | +
|
| 5295 | + And notes |
| 5296 | +
|
| 5297 | + Notes |
| 5298 | + ----- |
| 5299 | + original note |
| 5300 | + """ |
| 5301 | + pass |
| 5302 | + |
| 5303 | + expected_doc = """This docstring |
| 5304 | +
|
| 5305 | +Has multiple lines |
| 5306 | +
|
| 5307 | +And notes |
| 5308 | +
|
| 5309 | +Notes |
| 5310 | +----- |
| 5311 | +note |
| 5312 | +
|
| 5313 | +original note""" |
| 5314 | + |
| 5315 | + assert_equal(np.ma.core.doc_note(method.__doc__, "note"), expected_doc) |
0 commit comments