From f424b37d735a150e826107a135f978b1e5499479 Mon Sep 17 00:00:00 2001 From: Mathias Hauser Date: Wed, 6 Jan 2021 18:21:36 +0100 Subject: [PATCH 1/2] CI: ignore some warnings --- xarray/tests/test_backends_file_manager.py | 2 ++ xarray/tests/test_computation.py | 4 ++-- xarray/tests/test_variable.py | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/xarray/tests/test_backends_file_manager.py b/xarray/tests/test_backends_file_manager.py index eb8236b8613..1c7822af7b7 100644 --- a/xarray/tests/test_backends_file_manager.py +++ b/xarray/tests/test_backends_file_manager.py @@ -202,6 +202,8 @@ def test_file_manager_read(tmpdir, file_cache): manager.close() +# __init__ fails, thus, __del__ fails -> ignore the warning +@pytest.mark.filterwarnings("ignore:Exception ignored in") def test_file_manager_invalid_kwargs(): with pytest.raises(TypeError): CachingFileManager(open, "dummy", mode="w", invalid=True) diff --git a/xarray/tests/test_computation.py b/xarray/tests/test_computation.py index a1c8e75b6bc..4890536a5d7 100644 --- a/xarray/tests/test_computation.py +++ b/xarray/tests/test_computation.py @@ -924,11 +924,11 @@ def test_vectorize_dask_dtype_meta(): vectorize=True, dask="parallelized", output_dtypes=[int], - dask_gufunc_kwargs=dict(meta=np.ndarray((0, 0), dtype=np.float)), + dask_gufunc_kwargs=dict(meta=np.ndarray((0, 0), dtype=float)), ) assert_identical(expected, actual) - assert np.float == actual.dtype + assert float == actual.dtype def pandas_median_add(x, y): diff --git a/xarray/tests/test_variable.py b/xarray/tests/test_variable.py index e751179b84a..41bf24c7f88 100644 --- a/xarray/tests/test_variable.py +++ b/xarray/tests/test_variable.py @@ -835,6 +835,9 @@ def test_getitem_error(self): ], ) @pytest.mark.parametrize("xr_arg, np_arg", _PAD_XR_NP_ARGS) + @pytest.mark.filterwarnings( + r"ignore:dask.array.pad.+? converts integers to floats." + ) def test_pad(self, mode, xr_arg, np_arg): data = np.arange(4 * 3 * 2).reshape(4, 3, 2) v = self.cls(["x", "y", "z"], data) From 9e643cb00ea8078c4d5448942e0112335304d497 Mon Sep 17 00:00:00 2001 From: Mathias Hauser Date: Wed, 6 Jan 2021 23:16:14 +0100 Subject: [PATCH 2/2] remove test that is no longer necessary --- xarray/tests/test_backends_file_manager.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/xarray/tests/test_backends_file_manager.py b/xarray/tests/test_backends_file_manager.py index 1c7822af7b7..16f059c7bad 100644 --- a/xarray/tests/test_backends_file_manager.py +++ b/xarray/tests/test_backends_file_manager.py @@ -202,13 +202,6 @@ def test_file_manager_read(tmpdir, file_cache): manager.close() -# __init__ fails, thus, __del__ fails -> ignore the warning -@pytest.mark.filterwarnings("ignore:Exception ignored in") -def test_file_manager_invalid_kwargs(): - with pytest.raises(TypeError): - CachingFileManager(open, "dummy", mode="w", invalid=True) - - def test_file_manager_acquire_context(tmpdir, file_cache): path = str(tmpdir.join("testing.txt"))