Skip to content

Commit 23204f7

Browse files
committed
Add caller happy path tests
1 parent 542ea48 commit 23204f7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/test_async.py

+11
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,17 @@ async def test_retry_blocks_can_be_disabled():
212212

213213

214214
class TestAsyncRetryingCaller:
215+
async def test_ok(self):
216+
"""
217+
No error, no problem.
218+
"""
219+
arc = stamina.AsyncRetryingCaller().on(BaseException)
220+
221+
async def f():
222+
return 42
223+
224+
assert 42 == await arc(f)
225+
215226
async def test_retries(self):
216227
"""
217228
Retries if the specific error is raised. Arguments are passed through.

tests/test_sync.py

+11
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,17 @@ def test_never(self):
175175

176176

177177
class TestRetryingCaller:
178+
def test_ok(self):
179+
"""
180+
No error, no problem.
181+
"""
182+
rc = stamina.RetryingCaller().on(BaseException)
183+
184+
def f():
185+
return 42
186+
187+
assert 42 == rc(f)
188+
178189
def test_retries(self):
179190
"""
180191
Retries if the specific error is raised. Arguments are passed through.

0 commit comments

Comments
 (0)