Skip to content

Commit 8db1de1

Browse files
committed
Add code coverage test
1 parent cd69b6f commit 8db1de1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

zarr/tests/test_util.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,20 @@ def test_tree_widget_missing_ipytree():
179179

180180
def test_retry_call():
181181
class F:
182-
def __init__(self):
182+
183+
def __init__(self, fail_on=1):
183184
self.c = 0
185+
self.fail_on = fail_on
184186

185187
def __call__(self):
186188
self.c += 1
187-
if self.c == 1:
189+
if self.c == self.fail_on:
188190
raise PermissionError()
189191

190192
retry_call(F(), exceptions=(PermissionError,), wait=0)
191193

194+
# Catch the final clause
195+
retry_call(F(10), exceptions=(PermissionError,), wait=0)
196+
192197
pytest.raises(PermissionError,
193198
retry_call, F(), exceptions=(NotImplementedError,), wait=0)

0 commit comments

Comments
 (0)