Skip to content

Commit 6ea1129

Browse files
committed
pytest updates for 3.2
1 parent 6d9b2e6 commit 6ea1129

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

tests/test_server.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import logging
66

77
from libtmux import Server
8+
from libtmux.common import has_gte_version
89

910
logger = logging.getLogger(__name__)
1011

@@ -42,8 +43,11 @@ def test_config(server):
4243
def test_256_colors(server):
4344
myserver = Server(colors=256)
4445
assert myserver.colors == 256
46+
print(myserver.colors)
4547

46-
proc = myserver.cmd('list-servers')
48+
proc = myserver.cmd('list-sessions')
49+
50+
print('list-sessions', proc)
4751

4852
assert '-2' in proc.cmd
4953
assert '-8' not in proc.cmd
@@ -53,7 +57,7 @@ def test_88_colors(server):
5357
myserver = Server(colors=88)
5458
assert myserver.colors == 88
5559

56-
proc = myserver.cmd('list-servers')
60+
proc = myserver.cmd('list-sessions')
5761

5862
assert '-8' in proc.cmd
5963
assert '-2' not in proc.cmd
@@ -97,4 +101,8 @@ def test_new_session_shell(server):
97101
pane = window.list_panes()[0]
98102
assert mysession.get("session_name") == "test_new_session"
99103
assert server.has_session("test_new_session")
100-
assert pane.get('pane_start_command') == cmd
104+
105+
if has_gte_version('3.2'):
106+
assert pane.get('pane_start_command').replace('"', '') == cmd
107+
else:
108+
assert pane.get('pane_start_command') == cmd

tests/test_window.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ def test_split_window_shell(session):
115115
assert len(window.panes) == 2
116116
assert isinstance(pane, Pane)
117117
assert float(window.panes[0].height) <= ((float(window.width) + 1) / 2)
118-
assert pane.get('pane_start_command') == cmd
118+
if has_gte_version('3.2'):
119+
assert pane.get('pane_start_command').replace('"', '') == cmd
120+
else:
121+
assert pane.get('pane_start_command') == cmd
119122

120123

121124
def test_split_window_horizontal(session):

0 commit comments

Comments
 (0)