Skip to content

Commit d253720

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 d82871a commit d253720

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
@@ -268,44 +267,6 @@ def test_set_window_and_show_window_options(session: Session) -> None:
268267
assert window.show_window_option("pane-border-format") == " #P "
269268

270269

271-
def test_set_and_show_options(session: Session) -> None:
272-
"""Window.set_option() then Window._show_options(key)."""
273-
window = session.new_window(window_name="test_window")
274-
275-
window.set_option("main-pane-height", 20)
276-
if has_gte_version("3.0"):
277-
assert window._show_option("main-pane-height") == 20
278-
else:
279-
assert window._show_option("main-pane-height", scope=OptionScope.Window) == 20
280-
281-
window.set_option("main-pane-height", 40)
282-
283-
if has_gte_version("3.0"):
284-
assert window._show_option("main-pane-height") == 40
285-
else:
286-
assert window._show_option("main-pane-height", scope=OptionScope.Window) == 40
287-
288-
# By default, show-options will session scope, even if target is a window
289-
with pytest.raises(KeyError):
290-
assert window._show_options(scope=OptionScope.Session)["main-pane-height"] == 40
291-
292-
if has_gte_version("3.0"):
293-
assert window._show_option("main-pane-height") == 40
294-
else:
295-
assert window._show_option("main-pane-height", scope=OptionScope.Window) == 40
296-
297-
if has_gte_version("2.3"):
298-
window.set_option("pane-border-format", " #P ")
299-
300-
if has_gte_version("3.0"):
301-
assert window._show_option("pane-border-format") == " #P "
302-
else:
303-
assert (
304-
window._show_option("pane-border-format", scope=OptionScope.Window)
305-
== " #P "
306-
)
307-
308-
309270
def test_empty_window_option_returns_None(session: Session) -> None:
310271
"""Verify unset window option returns None."""
311272
window = session.new_window(window_name="test_window")

0 commit comments

Comments
 (0)