Skip to content

Commit d78af39

Browse files
committed
fix(tests): handle status-format version compatibility
WHAT: - Add version check for status-format option (added in tmux 2.9) - Update test assertions to handle version-specific behavior WHY: - Ensure tests pass on older tmux versions - Properly handle version-specific options - Improve test robustness across tmux versions
1 parent 1616798 commit d78af39

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: tests/test_options.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,15 @@ def test_stable_baseline_options_and_hooks(server: Server) -> None:
498498
assert "xterm*" in terminal_overrides
499499

500500
assert server.show_option("user-keys") is None
501-
assert server.show_option("status-format") is None
501+
502+
# status-format was added in tmux 2.9
503+
if has_gte_version("2.9"):
504+
status_format = server.show_option("status-format")
505+
assert isinstance(status_format, (dict, type(None)))
506+
else:
507+
with pytest.raises(OptionError):
508+
server.show_option("status-format")
509+
502510
assert server.show_option("update-environment") is None
503511

504512
# List variables: Pane

0 commit comments

Comments
 (0)