Skip to content

Commit

Permalink
tests: Handle Window.show_options scope mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Feb 8, 2024
1 parent 3a41eda commit e5c6186
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/legacy_api/test_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ def test_set_and_show_options(session: Session) -> None:

window.set_option("main-pane-height", 40)
assert window.show_option("main-pane-height") == 40
assert window.show_options()["main-pane-height"] == 40

# By default, show-options will session scope, even if target is a window
with pytest.raises(KeyError):
assert window.show_options()["main-pane-height"] == 40

if has_gte_version("2.3"):
window.set_option("pane-border-format", " #P ")
Expand Down
5 changes: 4 additions & 1 deletion tests/test_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ def test_set_and_show_window_options(session: Session) -> None:

window.set_option("main-pane-height", 40)
assert window.show_option("main-pane-height") == 40
assert window.show_options()["main-pane-height"] == 40

# By default, show-options will session scope, even if target is a window
with pytest.raises(KeyError):
assert window.show_options()["main-pane-height"] == 40

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

0 comments on commit e5c6186

Please sign in to comment.