tmux-python / tmux-python/tmuxp

1.52.2: `test_global_options` and `test_global_session_env_options` fail

Open
#961 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.6k
Forks
248
Avg merge
2h 13m
Merged PRs (30d)
1

Description

Hi! 👋
When trying to package 1.52.2 on Arch Linux I ran into test_global_options and test_global_session_env_options failing.

=================================== FAILURES ===================================
_____________________________ test_global_options ______________________________
tests/workspace/test_builder.py:252: in test_global_options
    builder.build(session=session)
        builder    = <tmuxp.workspace.builder.WorkspaceBuilder object at 0x763d337fb2a0>
        session    = Session($1 libtmux_on0xqzf_)
        workspace  = {'global_options': {'repeat-time': 493, 'status-position': 'top'},
 'session_name': 'test global options',
 'start_directory': '/tmp/pytest-of-builduser/pytest-0/home0/builduser',
 'windows': [{'panes': [{'shell_command': []},
                        {'shell_command': []},
                        {'shell_command': []}],
              'window_name': 'moo'}]}
test_dir/usr/lib/python3.13/site-packages/tmuxp/workspace/builder.py:310: in build
    self.session.set_option(option, value, global_=True)
E   TypeError: Session.set_option() got an unexpected keyword argument 'global_'. Did you mean '_global'?
        append     = False
        focus      = None
        option     = 'repeat-time'
        self       = <tmuxp.workspace.builder.WorkspaceBuilder object at 0x763d337fb2a0>
        session    = Session($1 libtmux_on0xqzf_)
        value      = 493
_______________________ test_global_session_env_options ________________________
tests/workspace/test_builder.py:278: in test_global_session_env_options
    builder.build(session=session)
        builder    = <tmuxp.workspace.builder.WorkspaceBuilder object at 0x763d3322a350>
        main_pane_height = 8
        monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x763d3322bee0>
        repeat_time = 738
        session    = Session($1 libtmux_ty4v9am8)
        visual_silence = 'on'
        workspace  = {'global_options': {'visual-silence': 'on'},
 'options': {'repeat-time': 738},
 'session_name': 'test env vars for options',
 'start_directory': '/tmp/pytest-of-builduser/pytest-0/home0/builduser',
 'windows': [{'layout': 'main-horizontal',
              'options': {'main-pane-height': '8'},
              'panes': [{'shell_command': []}],
              'window_name': 'moo'}]}
test_dir/usr/lib/python3.13/site-packages/tmuxp/workspace/builder.py:310: in build
    self.session.set_option(option, value, global_=True)
E   TypeError: Session.set_option() got an unexpected keyword argument 'global_'. Did you mean '_global'?
        append     = False
        focus      = None
        option     = 'visual-silence'
        self       = <tmuxp.workspace.builder.WorkspaceBuilder object at 0x763d3322a350>
        session    = Session($1 libtmux_ty4v9am8)
        value      = 'on'
=============================== warnings summary ===============================
tests/cli/test_cli.py::test_reattach_plugins
  /build/tmuxp/src/tmuxp-1.52.2/test_dir/usr/lib/python3.13/site-packages/tmuxp/cli/load.py:127: DeprecationWarning: Session.attach_session() is deprecated in favor of Session.attach()
    builder.session.attach_session()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/workspace/test_builder.py::test_global_options - TypeError: Session.set_option() got an unexpected keyword argument 'global_'. Did you mean '_global'?
FAILED tests/workspace/test_builder.py::test_global_session_env_options - TypeError: Session.set_option() got an unexpected keyword argument 'global_'. Did you mean '_global'?

tmuxp-1.52.2-1-x86_64-build.log
tmuxp-1.52.2-1-x86_64-check.log

I will disable these tests as I don't know how to fix them.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect tmuxp/workspace/builder.py at line 310 and the Session.set_option signature indicated by the traceback. Run tests/workspace/test_builder.py, especially test_global_options and test_global_session_env_options; done means both pass without disabling them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.