@@ -648,7 +648,7 @@ def test_group_create_array(
648
648
array = group .create_array (name = name , shape = shape , dtype = dtype )
649
649
array [:] = data
650
650
elif method == "array" :
651
- with pytest .warns (DeprecationWarning ):
651
+ with pytest .warns (DeprecationWarning , match = r"Group\.create_array instead\." ):
652
652
array = group .array (name = name , data = data , shape = shape , dtype = dtype )
653
653
else :
654
654
raise AssertionError
@@ -660,7 +660,7 @@ def test_group_create_array(
660
660
a [:] = data
661
661
elif method == "array" :
662
662
with pytest .raises (ContainsArrayError ): # noqa: PT012
663
- with pytest .warns (DeprecationWarning ):
663
+ with pytest .warns (DeprecationWarning , match = r"Group\.create_array instead\." ):
664
664
a = group .array (name = name , shape = shape , dtype = dtype )
665
665
a [:] = data
666
666
@@ -1184,22 +1184,28 @@ def test_create_dataset_with_data(store: Store, zarr_format: ZarrFormat) -> None
1184
1184
"""
1185
1185
root = Group .from_store (store = store , zarr_format = zarr_format )
1186
1186
arr = np .random .random ((5 , 5 ))
1187
- with pytest .warns (DeprecationWarning ):
1187
+ with pytest .warns (DeprecationWarning , match = r"Group\.create_array instead\." ):
1188
1188
data = root .create_dataset ("random" , data = arr , shape = arr .shape )
1189
1189
np .testing .assert_array_equal (np .asarray (data ), arr )
1190
1190
1191
1191
1192
1192
async def test_create_dataset (store : Store , zarr_format : ZarrFormat ) -> None :
1193
1193
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\." ):
1195
1195
foo = await root .create_dataset ("foo" , shape = (10 ,), dtype = "uint8" )
1196
1196
assert foo .shape == (10 ,)
1197
1197
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
+ ):
1199
1202
await root .create_dataset ("foo" , shape = (100 ,), dtype = "int8" )
1200
1203
1201
1204
_ = 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
+ ):
1203
1209
await root .create_dataset ("bar" , shape = (100 ,), dtype = "int8" )
1204
1210
1205
1211
0 commit comments