Skip to content

Commit

Permalink
Add caller happy path tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jan 29, 2024
1 parent 542ea48 commit 23204f7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,17 @@ async def test_retry_blocks_can_be_disabled():


class TestAsyncRetryingCaller:
async def test_ok(self):
"""
No error, no problem.
"""
arc = stamina.AsyncRetryingCaller().on(BaseException)

async def f():
return 42

assert 42 == await arc(f)

async def test_retries(self):
"""
Retries if the specific error is raised. Arguments are passed through.
Expand Down
11 changes: 11 additions & 0 deletions tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,17 @@ def test_never(self):


class TestRetryingCaller:
def test_ok(self):
"""
No error, no problem.
"""
rc = stamina.RetryingCaller().on(BaseException)

def f():
return 42

assert 42 == rc(f)

def test_retries(self):
"""
Retries if the specific error is raised. Arguments are passed through.
Expand Down

0 comments on commit 23204f7

Please sign in to comment.