Skip to content

Commit f3a5b21

Browse files
committed
Update tests
1 parent 6d54799 commit f3a5b21

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

tests/test_cli.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,25 @@
77

88
import pytest
99

10-
import kaptan
11-
1210
import click
11+
import kaptan
1312
from click.testing import CliRunner
13+
from tmuxp_test_plugin_bwb.plugin import PluginBeforeWorkspaceBuilder
1414

1515
import libtmux
1616
from libtmux.common import has_lt_version
1717
from libtmux.exc import LibTmuxException
1818
from tmuxp import cli, config, exc
1919
from tmuxp.cli import (
20+
_reattach,
2021
command_ls,
2122
get_config_dir,
2223
is_pure_name,
24+
load_plugins,
2325
load_workspace,
2426
scan_config,
25-
_reattach,
26-
load_plugins,
2727
)
2828
from tmuxp.workspacebuilder import WorkspaceBuilder
29-
from tmuxp_test_plugin_bwb.plugin import PluginBeforeWorkspaceBuilder
3029

3130
from .fixtures._util import curjoin, loadfixture
3231

@@ -538,7 +537,7 @@ def test_shell(
538537
{},
539538
{},
540539
LibTmuxException,
541-
r'.*DoesNotExist\s\(No such file or directory\).*',
540+
r'.*DoesNotExist.*',
542541
),
543542
(
544543
[

tmuxp/util.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ def raise_if_tmux_not_running(server):
8383
try:
8484
server.sessions
8585
except LibTmuxException as e:
86-
if 'No such file or directory' in str(e):
86+
if any(
87+
needle in str(e)
88+
for needle in ['No such file or directory', 'no server running on']
89+
):
8790
raise LibTmuxException(
8891
'no tmux session found. Start a tmux session and try again. \n'
8992
'Original error: ' + str(e)

0 commit comments

Comments
 (0)