Skip to content

Commit 8718357

Browse files
author
Martin Durant
committed
more cover
1 parent de2be88 commit 8718357

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

zarr/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ def _set_selection(self, indexer, value, fields=None):
15671567
else:
15681568
cv = value[out_selection]
15691569
# handle missing singleton dimensions
1570-
if indexer.drop_axes:
1570+
if indexer.drop_axes: # pragma: no cover
15711571
item = [slice(None)] * self.ndim
15721572
for a in indexer.drop_axes:
15731573
item[a] = np.newaxis

zarr/tests/test_storage.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,9 +976,17 @@ def test_s3_complex(self):
976976
storage_options=self.s3so)
977977

978978
assert (g2.data[:] == expected).all()
979+
980+
g2.data[:] = 5 # write with scalar
981+
assert (g2.data[:] == 5).all()
982+
979983
assert g2.data_f['foo'].tolist() == [b"aaa"] * 4 + [b"b"] * 4
980984
with pytest.raises(PermissionError):
981985
g2.data[:] = 5
986+
987+
with pytest.raises(PermissionError):
988+
g2.store.setitems({})
989+
982990
with pytest.raises(PermissionError):
983991
# even though overwrite=True, store is read-only, so fails
984992
g2.create_dataset("data", shape=(8, 8, 8), mode='w',

0 commit comments

Comments
 (0)