File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 1+ import pytest
2+
13import zarr .core
24import zarr .core .attributes
35import zarr .storage
@@ -61,11 +63,20 @@ def test_update_no_changes() -> None:
6163 assert dict (z .attrs ) == {"a" : [], "b" : 3 }
6264
6365
64- def test_del_works () -> None :
66+ @pytest .mark .parametrize ("group" , [True , False ])
67+ def test_del_works (group : bool ) -> None :
6568 store = zarr .storage .MemoryStore ()
66- z = zarr .create (10 , store = store , overwrite = True )
69+ if group :
70+ z = zarr .create_group (store )
71+ else :
72+ z = zarr .create_array (store = store , shape = 10 , dtype = int )
6773 assert dict (z .attrs ) == {}
6874 z .update_attributes ({"a" : [3 , 4 ], "c" : 4 })
6975 del z .attrs ["a" ]
70- assert "a" not in z .attrs
71- assert "c" in z .attrs
76+ assert dict (z .attrs ) == {"c" : 4 }
77+
78+ if group :
79+ z2 = zarr .open_group (store )
80+ else :
81+ z2 = zarr .open_array (store )
82+ assert dict (z2 .attrs ) == {"c" : 4 }
You can’t perform that action at this time.
0 commit comments