Skip to content

Commit 8fd18cc

Browse files
committed
tests(Window): For Window.default_scope
1 parent fb6edfc commit 8fd18cc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

tests/legacy_api/test_window.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,12 @@ def test_set_and_show_options(session: Session) -> None:
247247

248248
# By default, show-options will session scope, even if target is a window
249249
with pytest.raises(KeyError):
250-
assert window.show_options()["main-pane-height"] == 40
250+
if window.default_scope is None:
251+
assert window.show_options()["main-pane-height"] == 40
252+
else:
253+
assert (
254+
window.show_options(scope=OptionScope.Session)["main-pane-height"] == 40
255+
)
251256

252257
if has_gte_version("3.0"):
253258
assert window.show_option("main-pane-height") == 40

tests/test_window.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,12 @@ def test_set_and_show_window_options(session: Session) -> None:
280280

281281
# By default, show-options will session scope, even if target is a window
282282
with pytest.raises(KeyError):
283-
assert window.show_options()["main-pane-height"] == 40
283+
if window.default_scope is None:
284+
assert window.show_options()["main-pane-height"] == 40
285+
else:
286+
assert (
287+
window.show_options(scope=OptionScope.Session)["main-pane-height"] == 40
288+
)
284289

285290
if has_gte_version("3.0"):
286291
assert window.show_option("main-pane-height") == 40

0 commit comments

Comments
 (0)