()
| 5817 | |
| 5818 | |
| 5819 | def test_setting_fill_value_attribute(): |
| 5820 | # Regression test for gh-29421: setting .fill_value post-construction works too |
| 5821 | dt = np.dtypes.StringDType() |
| 5822 | arr = np.ma.MaskedArray( |
| 5823 | ["x", "longstring", "mid"], mask=[False, True, False], dtype=dt |
| 5824 | ) |
| 5825 | # Setting the attribute should not raise |
| 5826 | arr.fill_value = "Z" |
| 5827 | assert arr.fill_value == "Z" |
| 5828 | # And filled() should use the new fill_value |
| 5829 | assert arr.filled()[0] == "x" |
| 5830 | assert arr.filled()[1] == "Z" |
| 5831 | assert arr.filled()[2] == "mid" |
| 5832 | |
| 5833 | |
| 5834 | def test_ufunc_with_output(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…