Skip to content

Commit 5afa214

Browse files
committed
tests(test_options): Add test for g parameter deprecation warning
why: Verify that show_option() emits DeprecationWarning when deprecated g parameter is used what: - Add test_show_option_g_parameter_emits_deprecation_warning test - Ensures backward compatibility warning is properly raised
1 parent 90757c9 commit 5afa214

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_options.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from typing_extensions import LiteralString
2727

2828
from libtmux.server import Server
29+
from libtmux.session import Session
2930

3031

3132
def test_options(server: Server) -> None:
@@ -1276,3 +1277,12 @@ def test_convert_values_preserves_sparse_keys() -> None:
12761277
assert result[0] is True
12771278
assert result[5] is False
12781279
assert result[99] == 100
1280+
1281+
1282+
def test_show_option_g_parameter_emits_deprecation_warning(
1283+
session: Session,
1284+
) -> None:
1285+
"""Test show_option() emits DeprecationWarning when g parameter is used."""
1286+
server = session.server
1287+
with pytest.warns(DeprecationWarning, match=r"g argument is deprecated"):
1288+
server.show_option("buffer-limit", g=True)

0 commit comments

Comments
 (0)