================================================================================================ test session starts ================================================================================================ platform linux -- Python 3.10.4, pytest-7.1.2, pluggy-1.0.0 rootdir: /home/abraham/src/tmuxp, configfile: setup.cfg plugins: cov-3.0.0, rerunfailures-10.2, mock-3.7.0 collected 181 items tests/test_cli.py .............................FF....FF........................................s.......... [ 48%] tests/test_config.py ................. [ 58%] tests/test_config_teamocil.py ........ [ 62%] tests/test_config_tmuxinator.py ... [ 64%] tests/test_plugin.py .......... [ 69%] tests/test_shell.py .. [ 70%] tests/test_util.py ....... [ 74%] tests/test_workspacebuilder.py ...s.......^C ===================================================================================================== FAILURES ====================================================================================================== ______________________________________________________________________________ test_shell[cli_args1-inputs1-env1-{SESSION_NAME}-shell] ______________________________________________________________________________ cli_cmd = ['shell'], cli_args = ['shell', '-Ltmuxp_testtsd62zab', 'libtmux_rkxhx461', '-c', 'print(session.name)'], inputs = [], expected_output = '{SESSION_NAME}', env = {} tmp_path = PosixPath('/tmp/pytest-of-abraham/pytest-7/test_shell_cli_args1_inputs1_e0'), monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fbf6507e8c0> server = , session = Session($1 libtmux_rkxhx461) @pytest.mark.parametrize("cli_cmd", ["shell", ("shell", "--pdb")]) @pytest.mark.parametrize( "cli_args,inputs,env,expected_output", [ ( ["-L{SOCKET_NAME}", "-c", "print(str(server.socket_name))"], [], {}, "{SERVER_SOCKET_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "-c", "print(session.name)", ], [], {}, "{SESSION_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(server.has_session(session.name))", ], [], {}, "True", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(window.name)", ], [], {}, "{WINDOW_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(pane.id)", ], [], {}, "{PANE_ID}", ), ( [ "-L{SOCKET_NAME}", "-c", "print(pane.id)", ], [], {"TMUX_PANE": "{PANE_ID}"}, "{PANE_ID}", ), ], ) def test_shell( cli_cmd, cli_args, inputs, expected_output, env, tmp_path, monkeypatch, server, session, ): monkeypatch.setenv("HOME", str(tmp_path)) window_name = "my_window" window = session.new_window(window_name=window_name) window.split_window() template_ctx = dict( SOCKET_NAME=server.socket_name, SOCKET_PATH=server.socket_path, SESSION_NAME=session.name, WINDOW_NAME=window_name, PANE_ID=window.attached_pane.id, SERVER_SOCKET_NAME=server.socket_name, ) cli_cmd = list(cli_cmd) if isinstance(cli_cmd, (list, tuple)) else [cli_cmd] cli_args = cli_cmd + [cli_arg.format(**template_ctx) for cli_arg in cli_args] for k, v in env.items(): monkeypatch.setenv(k, v.format(**template_ctx)) monkeypatch.chdir(tmp_path) runner = CliRunner() > result = runner.invoke( cli.cli, cli_args, input="".join(inputs), catch_exceptions=False ) /home/abraham/src/tmuxp/tests/test_cli.py:593: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/testing.py:408: in invoke return_value = cli.main(args=args or (), prog_name=prog_name, **extra) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1055: in main rv = self.invoke(ctx) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1657: in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1404: in invoke return ctx.invoke(self.callback, **ctx.params) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:760: in invoke return __callback(*args, **kwargs) /home/abraham/src/tmuxp/tmuxp/cli/shell.py:81: in command_shell pane = util.get_pane(window=window, current_pane=current_pane) # NOQA: F841 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ window = None, current_pane = {'alternate_on': '0', 'alternate_saved_x': '4294967295', 'alternate_saved_y': '4294967295', 'cursor_flag': '1', ...} def get_pane(window, current_pane=None): try: if current_pane is not None: > pane = window.find_where({"pane_id": current_pane["pane_id"]}) # NOQA: F841 E AttributeError: 'NoneType' object has no attribute 'find_where' /home/abraham/src/tmuxp/tmuxp/util.py:145: AttributeError ____________________________________________________________________________ test_shell[cli_args1-inputs1-env1-{SESSION_NAME}-cli_cmd1] _____________________________________________________________________________ cli_cmd = ['shell', '--pdb'], cli_args = ['shell', '--pdb', '-Ltmuxp_test5f2k_jab', 'libtmux_ulud0ibr', '-c', 'print(session.name)'], inputs = [], expected_output = '{SESSION_NAME}', env = {} tmp_path = PosixPath('/tmp/pytest-of-abraham/pytest-7/test_shell_cli_args1_inputs1_e1'), monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fbf64e50880> server = , session = Session($1 libtmux_ulud0ibr) @pytest.mark.parametrize("cli_cmd", ["shell", ("shell", "--pdb")]) @pytest.mark.parametrize( "cli_args,inputs,env,expected_output", [ ( ["-L{SOCKET_NAME}", "-c", "print(str(server.socket_name))"], [], {}, "{SERVER_SOCKET_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "-c", "print(session.name)", ], [], {}, "{SESSION_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(server.has_session(session.name))", ], [], {}, "True", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(window.name)", ], [], {}, "{WINDOW_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(pane.id)", ], [], {}, "{PANE_ID}", ), ( [ "-L{SOCKET_NAME}", "-c", "print(pane.id)", ], [], {"TMUX_PANE": "{PANE_ID}"}, "{PANE_ID}", ), ], ) def test_shell( cli_cmd, cli_args, inputs, expected_output, env, tmp_path, monkeypatch, server, session, ): monkeypatch.setenv("HOME", str(tmp_path)) window_name = "my_window" window = session.new_window(window_name=window_name) window.split_window() template_ctx = dict( SOCKET_NAME=server.socket_name, SOCKET_PATH=server.socket_path, SESSION_NAME=session.name, WINDOW_NAME=window_name, PANE_ID=window.attached_pane.id, SERVER_SOCKET_NAME=server.socket_name, ) cli_cmd = list(cli_cmd) if isinstance(cli_cmd, (list, tuple)) else [cli_cmd] cli_args = cli_cmd + [cli_arg.format(**template_ctx) for cli_arg in cli_args] for k, v in env.items(): monkeypatch.setenv(k, v.format(**template_ctx)) monkeypatch.chdir(tmp_path) runner = CliRunner() > result = runner.invoke( cli.cli, cli_args, input="".join(inputs), catch_exceptions=False ) /home/abraham/src/tmuxp/tests/test_cli.py:593: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/testing.py:408: in invoke return_value = cli.main(args=args or (), prog_name=prog_name, **extra) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1055: in main rv = self.invoke(ctx) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1657: in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1404: in invoke return ctx.invoke(self.callback, **ctx.params) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:760: in invoke return __callback(*args, **kwargs) /home/abraham/src/tmuxp/tmuxp/cli/shell.py:81: in command_shell pane = util.get_pane(window=window, current_pane=current_pane) # NOQA: F841 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ window = None, current_pane = {'alternate_on': '0', 'alternate_saved_x': '4294967295', 'alternate_saved_y': '4294967295', 'cursor_flag': '1', ...} def get_pane(window, current_pane=None): try: if current_pane is not None: > pane = window.find_where({"pane_id": current_pane["pane_id"]}) # NOQA: F841 E AttributeError: 'NoneType' object has no attribute 'find_where' /home/abraham/src/tmuxp/tmuxp/util.py:145: AttributeError ________________________________________________________________________________ test_shell[cli_args4-inputs4-env4-{PANE_ID}-shell] _________________________________________________________________________________ cli_cmd = ['shell'], cli_args = ['shell', '-Ltmuxp_testh3b_c369', 'libtmux_og0uvzqj', 'my_window', '-c', 'print(pane.id)'], inputs = [], expected_output = '{PANE_ID}', env = {} tmp_path = PosixPath('/tmp/pytest-of-abraham/pytest-7/test_shell_cli_args4_inputs4_e0'), monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fbf64ef3970> server = , session = Session($1 libtmux_og0uvzqj) @pytest.mark.parametrize("cli_cmd", ["shell", ("shell", "--pdb")]) @pytest.mark.parametrize( "cli_args,inputs,env,expected_output", [ ( ["-L{SOCKET_NAME}", "-c", "print(str(server.socket_name))"], [], {}, "{SERVER_SOCKET_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "-c", "print(session.name)", ], [], {}, "{SESSION_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(server.has_session(session.name))", ], [], {}, "True", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(window.name)", ], [], {}, "{WINDOW_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(pane.id)", ], [], {}, "{PANE_ID}", ), ( [ "-L{SOCKET_NAME}", "-c", "print(pane.id)", ], [], {"TMUX_PANE": "{PANE_ID}"}, "{PANE_ID}", ), ], ) def test_shell( cli_cmd, cli_args, inputs, expected_output, env, tmp_path, monkeypatch, server, session, ): monkeypatch.setenv("HOME", str(tmp_path)) window_name = "my_window" window = session.new_window(window_name=window_name) window.split_window() template_ctx = dict( SOCKET_NAME=server.socket_name, SOCKET_PATH=server.socket_path, SESSION_NAME=session.name, WINDOW_NAME=window_name, PANE_ID=window.attached_pane.id, SERVER_SOCKET_NAME=server.socket_name, ) cli_cmd = list(cli_cmd) if isinstance(cli_cmd, (list, tuple)) else [cli_cmd] cli_args = cli_cmd + [cli_arg.format(**template_ctx) for cli_arg in cli_args] for k, v in env.items(): monkeypatch.setenv(k, v.format(**template_ctx)) monkeypatch.chdir(tmp_path) runner = CliRunner() > result = runner.invoke( cli.cli, cli_args, input="".join(inputs), catch_exceptions=False ) /home/abraham/src/tmuxp/tests/test_cli.py:593: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/testing.py:408: in invoke return_value = cli.main(args=args or (), prog_name=prog_name, **extra) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1055: in main rv = self.invoke(ctx) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1657: in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1404: in invoke return ctx.invoke(self.callback, **ctx.params) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:760: in invoke return __callback(*args, **kwargs) /home/abraham/src/tmuxp/tmuxp/cli/shell.py:84: in command_shell exec(command) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E AttributeError: 'NoneType' object has no attribute 'id' :1: AttributeError _______________________________________________________________________________ test_shell[cli_args4-inputs4-env4-{PANE_ID}-cli_cmd1] _______________________________________________________________________________ cli_cmd = ['shell', '--pdb'], cli_args = ['shell', '--pdb', '-Ltmuxp_testi6r8o6fi', 'libtmux__dcff33g', 'my_window', '-c', ...], inputs = [], expected_output = '{PANE_ID}', env = {} tmp_path = PosixPath('/tmp/pytest-of-abraham/pytest-7/test_shell_cli_args4_inputs4_e1'), monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fbf64f27010> server = , session = Session($1 libtmux__dcff33g) @pytest.mark.parametrize("cli_cmd", ["shell", ("shell", "--pdb")]) @pytest.mark.parametrize( "cli_args,inputs,env,expected_output", [ ( ["-L{SOCKET_NAME}", "-c", "print(str(server.socket_name))"], [], {}, "{SERVER_SOCKET_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "-c", "print(session.name)", ], [], {}, "{SESSION_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(server.has_session(session.name))", ], [], {}, "True", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(window.name)", ], [], {}, "{WINDOW_NAME}", ), ( [ "-L{SOCKET_NAME}", "{SESSION_NAME}", "{WINDOW_NAME}", "-c", "print(pane.id)", ], [], {}, "{PANE_ID}", ), ( [ "-L{SOCKET_NAME}", "-c", "print(pane.id)", ], [], {"TMUX_PANE": "{PANE_ID}"}, "{PANE_ID}", ), ], ) def test_shell( cli_cmd, cli_args, inputs, expected_output, env, tmp_path, monkeypatch, server, session, ): monkeypatch.setenv("HOME", str(tmp_path)) window_name = "my_window" window = session.new_window(window_name=window_name) window.split_window() template_ctx = dict( SOCKET_NAME=server.socket_name, SOCKET_PATH=server.socket_path, SESSION_NAME=session.name, WINDOW_NAME=window_name, PANE_ID=window.attached_pane.id, SERVER_SOCKET_NAME=server.socket_name, ) cli_cmd = list(cli_cmd) if isinstance(cli_cmd, (list, tuple)) else [cli_cmd] cli_args = cli_cmd + [cli_arg.format(**template_ctx) for cli_arg in cli_args] for k, v in env.items(): monkeypatch.setenv(k, v.format(**template_ctx)) monkeypatch.chdir(tmp_path) runner = CliRunner() > result = runner.invoke( cli.cli, cli_args, input="".join(inputs), catch_exceptions=False ) /home/abraham/src/tmuxp/tests/test_cli.py:593: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/testing.py:408: in invoke return_value = cli.main(args=args or (), prog_name=prog_name, **extra) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1055: in main rv = self.invoke(ctx) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1657: in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:1404: in invoke return ctx.invoke(self.callback, **ctx.params) /home/abraham/src/tmuxp/.venv/lib/python3.10/site-packages/click/core.py:760: in invoke return __callback(*args, **kwargs) /home/abraham/src/tmuxp/tmuxp/cli/shell.py:84: in command_shell exec(command) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E AttributeError: 'NoneType' object has no attribute 'id' :1: AttributeError ============================================================================================== short test summary info ============================================================================================== FAILED tests/test_cli.py::test_shell[cli_args1-inputs1-env1-{SESSION_NAME}-shell] - AttributeError: 'NoneType' object has no attribute 'find_where' FAILED tests/test_cli.py::test_shell[cli_args1-inputs1-env1-{SESSION_NAME}-cli_cmd1] - AttributeError: 'NoneType' object has no attribute 'find_where' FAILED tests/test_cli.py::test_shell[cli_args4-inputs4-env4-{PANE_ID}-shell] - AttributeError: 'NoneType' object has no attribute 'id' FAILED tests/test_cli.py::test_shell[cli_args4-inputs4-env4-{PANE_ID}-cli_cmd1] - AttributeError: 'NoneType' object has no attribute 'id' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /usr/lib/python3.10/os.py:754: KeyboardInterrupt (to show a full traceback on KeyboardInterrupt use --full-trace) ===================================================================================== 4 failed, 140 passed, 2 skipped in 46.11s =====================================================================================