()
| 905 | |
| 906 | |
| 907 | def test_mean_func_does_not_warn(): |
| 908 | # non-regression test for https://github.com/pydata/xarray/issues/5151 |
| 909 | xr = pytest.importorskip("xarray") |
| 910 | a = xr.DataArray(da.from_array(np.full((10, 10), np.nan))) |
| 911 | |
| 912 | with warnings.catch_warnings(record=True) as rec: |
| 913 | a.mean().compute() |
| 914 | assert not rec # did not warn |
| 915 | |
| 916 | |
| 917 | @pytest.mark.parametrize("func", ["nanvar", "nanstd"]) |