@@ -648,7 +648,7 @@ def test_group_create_array(
648648 array = group .create_array (name = name , shape = shape , dtype = dtype )
649649 array [:] = data
650650 elif method == "array" :
651- with pytest .warns (DeprecationWarning ):
651+ with pytest .warns (DeprecationWarning , match = r"Group\.create_array instead\." ):
652652 array = group .array (name = name , data = data , shape = shape , dtype = dtype )
653653 else :
654654 raise AssertionError
@@ -660,7 +660,7 @@ def test_group_create_array(
660660 a [:] = data
661661 elif method == "array" :
662662 with pytest .raises (ContainsArrayError ): # noqa: PT012
663- with pytest .warns (DeprecationWarning ):
663+ with pytest .warns (DeprecationWarning , match = r"Group\.create_array instead\." ):
664664 a = group .array (name = name , shape = shape , dtype = dtype )
665665 a [:] = data
666666
@@ -1184,22 +1184,28 @@ def test_create_dataset_with_data(store: Store, zarr_format: ZarrFormat) -> None
11841184 """
11851185 root = Group .from_store (store = store , zarr_format = zarr_format )
11861186 arr = np .random .random ((5 , 5 ))
1187- with pytest .warns (DeprecationWarning ):
1187+ with pytest .warns (DeprecationWarning , match = r"Group\.create_array instead\." ):
11881188 data = root .create_dataset ("random" , data = arr , shape = arr .shape )
11891189 np .testing .assert_array_equal (np .asarray (data ), arr )
11901190
11911191
11921192async def test_create_dataset (store : Store , zarr_format : ZarrFormat ) -> None :
11931193 root = await AsyncGroup .from_store (store = store , zarr_format = zarr_format )
1194- with pytest .warns (DeprecationWarning ):
1194+ with pytest .warns (DeprecationWarning , match = r"Group\.create_array instead\." ):
11951195 foo = await root .create_dataset ("foo" , shape = (10 ,), dtype = "uint8" )
11961196 assert foo .shape == (10 ,)
11971197
1198- with pytest .raises (ContainsArrayError ), pytest .warns (DeprecationWarning ):
1198+ with (
1199+ pytest .raises (ContainsArrayError ),
1200+ pytest .warns (DeprecationWarning , match = r"Group\.create_array instead\." ),
1201+ ):
11991202 await root .create_dataset ("foo" , shape = (100 ,), dtype = "int8" )
12001203
12011204 _ = await root .create_group ("bar" )
1202- with pytest .raises (ContainsGroupError ), pytest .warns (DeprecationWarning ):
1205+ with (
1206+ pytest .raises (ContainsGroupError ),
1207+ pytest .warns (DeprecationWarning , match = r"Group\.create_array instead\." ),
1208+ ):
12031209 await root .create_dataset ("bar" , shape = (100 ,), dtype = "int8" )
12041210
12051211
0 commit comments