Skip to content

Commit 99b6550

Browse files
committed
add some docstring
1 parent f8fbaad commit 99b6550

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_workspacebuilder.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@
2424

2525

2626
def retry(seconds=RETRY_TIMEOUT_SECONDS):
27+
"""Retry a block of code until a time limit or ``break``.
28+
29+
.. code-block:: python
30+
31+
while retry():
32+
p = w.attached_pane
33+
p.server._update_panes()
34+
if p.current_path == pane_path:
35+
break
36+
37+
38+
:param seconds: Seconds to retry, defaults to ``RETRY_TIMEOUT_SECONDS``,
39+
which is configurable via environmental variables.
40+
:type seconds: int
41+
:rtype: void
42+
43+
:todo: Move to libtmux.test
44+
"""
2745
return (lambda: time.time() < time.time() + seconds)()
2846

2947

0 commit comments

Comments
 (0)