Skip to content

Commit

Permalink
Add test to LazyStr
Browse files Browse the repository at this point in the history
  • Loading branch information
isra17 committed Jun 14, 2024
1 parent 78f51aa commit 5fe243b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,17 @@ def test_settings_from_socket_dsn():
'retry': None,
'max_connections': None,
}


def test_lazy_str():
called = False

def get_str() -> str:
nonlocal called
called = True
return 'get_str'

lazy_str = arq.utils.LazyStr(get_str)
assert not called
assert str(lazy_str) == 'get_str'
assert called

0 comments on commit 5fe243b

Please sign in to comment.