Skip to content

Commit 35d3222

Browse files
committed
tests: Handle Window.show_options scope mismatch
1 parent f33af24 commit 35d3222

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tests/legacy_api/test_window.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ def test_set_and_show_options(session: Session) -> None:
236236

237237
window.set_option("main-pane-height", 40)
238238
assert window.show_option("main-pane-height") == 40
239-
assert window.show_options()["main-pane-height"] == 40
239+
240+
# By default, show-options will session scope, even if target is a window
241+
with pytest.raises(KeyError):
242+
assert window.show_options()["main-pane-height"] == 40
240243

241244
if has_gte_version("2.3"):
242245
window.set_option("pane-border-format", " #P ")

tests/test_window.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def test_window_rename(
184184
window_name_before = "test"
185185
window_name_after = "ha ha ha fjewlkjflwef"
186186

187-
session.set_option("automatic-rename", "off")
187+
session.set_option("automatic-rename", "off", scope=None)
188188
window = session.new_window(window_name=window_name_before, attach=True)
189189

190190
assert window == session.attached_window
@@ -270,7 +270,10 @@ def test_set_and_show_window_options(session: Session) -> None:
270270

271271
window.set_option("main-pane-height", 40)
272272
assert window.show_option("main-pane-height") == 40
273-
assert window.show_options()["main-pane-height"] == 40
273+
274+
# By default, show-options will session scope, even if target is a window
275+
with pytest.raises(KeyError):
276+
assert window.show_options()["main-pane-height"] == 40
274277

275278
if has_gte_version("2.3"):
276279
window.set_option("pane-border-format", " #P ")

0 commit comments

Comments
 (0)