@@ -2435,10 +2435,16 @@ def test_warning_on_bad_chunks(self) -> None:
24352435 for chunks in good_chunks :
24362436 kwargs = {"chunks" : chunks }
24372437 with assert_no_warnings ():
2438- with self .roundtrip (original , open_kwargs = kwargs ) as actual :
2439- for k , v in actual .variables .items ():
2440- # only index variables should be in memory
2441- assert v ._in_memory == (k in actual .dims )
2438+ with warnings .catch_warnings ():
2439+ warnings .filterwarnings (
2440+ "ignore" ,
2441+ message = ".*Zarr version 3 specification.*" ,
2442+ category = UserWarning ,
2443+ )
2444+ with self .roundtrip (original , open_kwargs = kwargs ) as actual :
2445+ for k , v in actual .variables .items ():
2446+ # only index variables should be in memory
2447+ assert v ._in_memory == (k in actual .dims )
24422448
24432449 @requires_dask
24442450 def test_deprecate_auto_chunk (self ) -> None :
@@ -2985,8 +2991,14 @@ def test_save_emptydim(self, chunk) -> None:
29852991 def test_no_warning_from_open_emptydim_with_chunks (self ) -> None :
29862992 ds = Dataset ({"x" : (("a" , "b" ), np .empty ((5 , 0 )))}).chunk ({"a" : 1 })
29872993 with assert_no_warnings ():
2988- with self .roundtrip (ds , open_kwargs = dict (chunks = {"a" : 1 })) as ds_reload :
2989- assert_identical (ds , ds_reload )
2994+ with warnings .catch_warnings ():
2995+ warnings .filterwarnings (
2996+ "ignore" ,
2997+ message = ".*Zarr version 3 specification.*" ,
2998+ category = UserWarning ,
2999+ )
3000+ with self .roundtrip (ds , open_kwargs = dict (chunks = {"a" : 1 })) as ds_reload :
3001+ assert_identical (ds , ds_reload )
29903002
29913003 @pytest .mark .parametrize ("consolidated" , [False , True , None ])
29923004 @pytest .mark .parametrize ("compute" , [False , True ])
0 commit comments