File tree 3 files changed +14
-1
lines changed
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ $ pip install --user --upgrade --pre libtmux
14
14
15
15
<!-- Maintainers and contributors: Insert change notes for the next release above -->
16
16
17
+ ### Improvement
18
+
19
+ - ` fetch_objs ` now raises ` ObjectDoesNotExist ` with detailed information on
20
+ lookup that failed (#466 )
21
+
17
22
## libtmux 0.18.2 (2022-12-30)
18
23
19
24
### Fixes
Original file line number Diff line number Diff line change 3
3
import typing as t
4
4
5
5
from libtmux import exc
6
+ from libtmux ._internal .query_list import ObjectDoesNotExist
6
7
from libtmux .common import tmux_cmd
7
8
from libtmux .formats import FORMAT_SEPARATOR
8
9
@@ -239,6 +240,12 @@ def fetch_obj(
239
240
if _obj .get (obj_key ) == obj_id :
240
241
obj = _obj
241
242
243
+ if obj is None :
244
+ raise ObjectDoesNotExist (
245
+ f"Could not find { obj_key } ={ obj_id } for { list_cmd } "
246
+ f'{ list_extra_args if list_extra_args is not None else "" } '
247
+ )
248
+
242
249
assert obj is not None
243
250
244
251
return obj
Original file line number Diff line number Diff line change 7
7
import pytest
8
8
9
9
from libtmux import exc
10
+ from libtmux ._internal .query_list import ObjectDoesNotExist
10
11
from libtmux .common import has_gte_version , has_lt_version
11
12
from libtmux .pane import Pane
12
13
from libtmux .server import Server
@@ -205,7 +206,7 @@ def test_kill_window(session: Session) -> None:
205
206
w .window_id
206
207
207
208
w .kill_window ()
208
- with pytest .raises (AssertionError ): # TODO: Replace this will an object not found
209
+ with pytest .raises (ObjectDoesNotExist ):
209
210
w .refresh ()
210
211
211
212
You can’t perform that action at this time.
0 commit comments