Skip to content

Commit d220074

Browse files
committed
!squash test workaround
1 parent e3423be commit d220074

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

tests/test_workspacebuilder.py

+33-2
Original file line numberDiff line numberDiff line change
@@ -1223,15 +1223,42 @@ def is_almost_equal(x, y):
12231223
assert is_almost_equal(width(panes[0]), width(panes[1]))
12241224

12251225

1226-
@pytest.mark.skipif(has_lt_version("2.9"), reason="default-size only applies there")
1226+
class DefaultSizeNamespaceFixture(t.NamedTuple):
1227+
test_id: str
1228+
TMUXP_DEFAULT_SIZE: t.Optional[str]
1229+
raises: bool
1230+
confoverrides: t.Dict[str, t.Any]
1231+
1232+
1233+
DEFAULT_SIZE_FIXTURES = [
1234+
DefaultSizeNamespaceFixture(
1235+
test_id="v1.13.1 default-size-breaks",
1236+
TMUXP_DEFAULT_SIZE=None,
1237+
raises=True,
1238+
confoverrides={},
1239+
),
1240+
DefaultSizeNamespaceFixture(
1241+
test_id="v1.13.1-option-workaround",
1242+
TMUXP_DEFAULT_SIZE=None,
1243+
raises=False,
1244+
confoverrides={"options": {"default-size": "800x600"}},
1245+
),
1246+
]
1247+
1248+
12271249
@pytest.mark.parametrize(
1228-
"TMUXP_DEFAULT_SIZE,raises", [[None, True], ["800x600", False]]
1250+
DefaultSizeNamespaceFixture._fields,
1251+
DEFAULT_SIZE_FIXTURES,
1252+
ids=[f.test_id for f in DEFAULT_SIZE_FIXTURES],
12291253
)
1254+
@pytest.mark.skipif(has_lt_version("2.9"), reason="default-size only applies there")
12301255
def test_issue_800_default_size_many_windows(
12311256
server: "Server",
12321257
monkeypatch: pytest.MonkeyPatch,
1258+
test_id: str,
12331259
TMUXP_DEFAULT_SIZE: t.Optional[str],
12341260
raises: bool,
1261+
confoverrides: t.Dict[str, t.Any],
12351262
) -> None:
12361263
"""Recreate default-size issue.
12371264
@@ -1248,6 +1275,10 @@ def test_issue_800_default_size_many_windows(
12481275
sconfig = config.expand(sconfig)
12491276
sconfig = config.trickle(sconfig)
12501277

1278+
if isinstance(confoverrides, dict):
1279+
for k, v in confoverrides.items():
1280+
sconfig[k] = v
1281+
12511282
if TMUXP_DEFAULT_SIZE is not None:
12521283
monkeypatch.setenv("TMUXP_DEFAULT_SIZE", TMUXP_DEFAULT_SIZE)
12531284

0 commit comments

Comments
 (0)