Skip to content

Commit 184d229

Browse files
committed
tests(legacy_api/test_window): Remove duplicate test_set_and_show_options
why: Test was duplicating functionality already covered in tests/test_window.py what: - Remove test_set_and_show_options that tested NEW API in LEGACY test file - Remove unused OptionScope import - Same functionality tested in test_set_and_show_window_options (test_window.py:327)
1 parent 7b2d7a4 commit 184d229

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

tests/legacy_api/test_window.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
from libtmux import exc
1313
from libtmux.common import has_gte_version, has_version
14-
from libtmux.constants import OptionScope
1514
from libtmux.pane import Pane
1615
from libtmux.server import Server
1716
from libtmux.window import Window
@@ -285,44 +284,6 @@ def test_set_window_and_show_window_options(session: Session) -> None:
285284
assert window.show_window_option("pane-border-format") == " #P "
286285

287286

288-
def test_set_and_show_options(session: Session) -> None:
289-
"""Window.set_option() then Window._show_options(key)."""
290-
window = session.new_window(window_name="test_window")
291-
292-
window.set_option("main-pane-height", 20)
293-
if has_gte_version("3.0"):
294-
assert window._show_option("main-pane-height") == 20
295-
else:
296-
assert window._show_option("main-pane-height", scope=OptionScope.Window) == 20
297-
298-
window.set_option("main-pane-height", 40)
299-
300-
if has_gte_version("3.0"):
301-
assert window._show_option("main-pane-height") == 40
302-
else:
303-
assert window._show_option("main-pane-height", scope=OptionScope.Window) == 40
304-
305-
# By default, show-options will session scope, even if target is a window
306-
with pytest.raises(KeyError):
307-
assert window._show_options(scope=OptionScope.Session)["main-pane-height"] == 40
308-
309-
if has_gte_version("3.0"):
310-
assert window._show_option("main-pane-height") == 40
311-
else:
312-
assert window._show_option("main-pane-height", scope=OptionScope.Window) == 40
313-
314-
if has_gte_version("2.3"):
315-
window.set_option("pane-border-format", " #P ")
316-
317-
if has_gte_version("3.0"):
318-
assert window._show_option("pane-border-format") == " #P "
319-
else:
320-
assert (
321-
window._show_option("pane-border-format", scope=OptionScope.Window)
322-
== " #P "
323-
)
324-
325-
326287
def test_empty_window_option_returns_None(session: Session) -> None:
327288
"""Verify unset window option returns None."""
328289
window = session.new_window(window_name="test_window")

0 commit comments

Comments
 (0)