Skip to content

Commit b5e8be9

Browse files
authored
chore!(test): Remove retry(), deprecated in 0.13 (#393)
Deprecated via #368
2 parents a2f5288 + 826df17 commit b5e8be9

File tree

2 files changed

+9
-43
lines changed

2 files changed

+9
-43
lines changed

CHANGES

+9-7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ $ pip install --user --upgrade --pre libtmux
1212

1313
- _Insert changes/features/fixes for next release here_
1414

15+
## What's new
16+
17+
- **Improved typings**
18+
19+
Now [`mypy --strict`] compliant ({issue}`383`)
20+
21+
[`mypy --strict`]: https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-strict
22+
1523
### Breaking changes
1624

1725
- Deprecated individual item lookups ({issue}`390`)
@@ -61,13 +69,7 @@ $ pip install --user --upgrade --pre libtmux
6169
window.show_window_option('DISPLAY')
6270
```
6371

64-
## What's new
65-
66-
- **Improved typings**
67-
68-
Now [`mypy --strict`] compliant ({issue}`383`)
69-
70-
[`mypy --strict`]: https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-strict
72+
- Remove `libtmux.test.retry()`, deprecated since 0.12.x ({issue}`393`)
7173

7274
### Development
7375

libtmux/test.py

-36
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import time
77
import types
88
import typing as t
9-
import warnings
109
from typing import Callable, Optional
1110

1211
from libtmux.server import Server
@@ -42,41 +41,6 @@ def __next__(self) -> str:
4241
fixtures_dir = os.path.realpath(os.path.join(current_dir, "fixtures"))
4342

4443

45-
def retry(seconds: float = RETRY_TIMEOUT_SECONDS) -> bool:
46-
"""
47-
Retry a block of code until a time limit or ``break``.
48-
49-
.. deprecated:: 0.12.0
50-
`retry` doesn't work, it will be removed in libtmux 0.13.0, it is replaced by
51-
`retry_until`, more info: https://github.com/tmux-python/libtmux/issues/368.
52-
53-
Parameters
54-
----------
55-
seconds : float
56-
Seconds to retry, defaults to ``RETRY_TIMEOUT_SECONDS``, which is
57-
configurable via environmental variables.
58-
59-
Returns
60-
-------
61-
bool
62-
True if time passed since retry() invoked less than seconds param.
63-
64-
Examples
65-
--------
66-
67-
>>> while retry():
68-
... p = w.attached_pane
69-
... p.server._update_panes()
70-
... if p.current_path == pane_path:
71-
... break
72-
"""
73-
warnings.warn(
74-
"retry() is being deprecated and will soon be replaced by retry_until()",
75-
DeprecationWarning,
76-
)
77-
return (lambda: time.time() < time.time() + seconds)()
78-
79-
8044
def retry_until(
8145
fun: Callable[[], bool],
8246
seconds: float = RETRY_TIMEOUT_SECONDS,

0 commit comments

Comments
 (0)