@@ -209,6 +209,81 @@ class CLILoadFixture(t.NamedTuple):
209209 expected_not_in_err : ExpectedOutput = None
210210
211211
212+ class ZshAutotitleTestFixture (t .NamedTuple ):
213+ """Test fixture for zsh auto title warning tests."""
214+
215+ test_id : str
216+ cli_args : list [str ]
217+
218+
219+ class LogFileTestFixture (t .NamedTuple ):
220+ """Test fixture for log file tests."""
221+
222+ test_id : str
223+ cli_args : list [str ]
224+
225+
226+ class PluginVersionTestFixture (t .NamedTuple ):
227+ """Test fixture for plugin version tests."""
228+
229+ test_id : str
230+ cli_args : list [str ]
231+ inputs : list [str ]
232+
233+
234+ class PluginMissingTestFixture (t .NamedTuple ):
235+ """Test fixture for plugin missing tests."""
236+
237+ test_id : str
238+ cli_args : list [str ]
239+
240+
241+ ZSH_AUTOTITLE_TEST_FIXTURES : list [ZshAutotitleTestFixture ] = [
242+ ZshAutotitleTestFixture (
243+ test_id = "load_dot_detached" ,
244+ cli_args = ["load" , "." , "-d" ],
245+ ),
246+ ZshAutotitleTestFixture (
247+ test_id = "load_yaml_detached" ,
248+ cli_args = ["load" , ".tmuxp.yaml" , "-d" ],
249+ ),
250+ ]
251+
252+
253+ LOG_FILE_TEST_FIXTURES : list [LogFileTestFixture ] = [
254+ LogFileTestFixture (
255+ test_id = "load_with_log_file" ,
256+ cli_args = ["load" , "." , "--log-file" , "log.txt" , "-d" ],
257+ ),
258+ ]
259+
260+
261+ PLUGIN_VERSION_SKIP_TEST_FIXTURES : list [PluginVersionTestFixture ] = [
262+ PluginVersionTestFixture (
263+ test_id = "skip_version_fail" ,
264+ cli_args = ["load" , "tests/fixtures/workspace/builder/plugin_versions_fail.yaml" ],
265+ inputs = ["y\n " ],
266+ ),
267+ ]
268+
269+
270+ PLUGIN_VERSION_NO_SKIP_TEST_FIXTURES : list [PluginVersionTestFixture ] = [
271+ PluginVersionTestFixture (
272+ test_id = "no_skip_version_fail" ,
273+ cli_args = ["load" , "tests/fixtures/workspace/builder/plugin_versions_fail.yaml" ],
274+ inputs = ["n\n " ],
275+ ),
276+ ]
277+
278+
279+ PLUGIN_MISSING_TEST_FIXTURES : list [PluginMissingTestFixture ] = [
280+ PluginMissingTestFixture (
281+ test_id = "missing_plugin" ,
282+ cli_args = ["load" , "tests/fixtures/workspace/builder/plugin_missing_fail.yaml" ],
283+ ),
284+ ]
285+
286+
212287TEST_LOAD_FIXTURES : list [CLILoadFixture ] = [
213288 CLILoadFixture (
214289 test_id = "dir-relative-dot-samedir" ,
@@ -360,17 +435,19 @@ def test_regression_00132_session_name_with_dots(
360435
361436
362437@pytest .mark .parametrize (
363- "cli_args" ,
364- [["load" , "." , "-d" ], ["load" , ".tmuxp.yaml" , "-d" ]],
438+ list (ZshAutotitleTestFixture ._fields ),
439+ ZSH_AUTOTITLE_TEST_FIXTURES ,
440+ ids = [test .test_id for test in ZSH_AUTOTITLE_TEST_FIXTURES ],
365441)
366442def test_load_zsh_autotitle_warning (
443+ test_id : str ,
367444 cli_args : list [str ],
368445 tmp_path : pathlib .Path ,
369446 monkeypatch : pytest .MonkeyPatch ,
370447 capsys : pytest .CaptureFixture [str ],
371448 server : Server ,
372449) -> None :
373- """Test loading ZSH without DISABLE_AUTO_TITLE raises warning ."""
450+ """Test warning when ZSH auto title is enabled ."""
374451 # create dummy tmuxp yaml so we don't get yelled at
375452 yaml_config = tmp_path / ".tmuxp.yaml"
376453 yaml_config .write_text (
@@ -418,18 +495,18 @@ def test_load_zsh_autotitle_warning(
418495
419496
420497@pytest .mark .parametrize (
421- "cli_args" ,
422- [
423- (["load" , "." , "--log-file" , "log.txt" , "-d" ]),
424- ],
498+ list (LogFileTestFixture ._fields ),
499+ LOG_FILE_TEST_FIXTURES ,
500+ ids = [test .test_id for test in LOG_FILE_TEST_FIXTURES ],
425501)
426502def test_load_log_file (
503+ test_id : str ,
427504 cli_args : list [str ],
428505 tmp_path : pathlib .Path ,
429506 monkeypatch : pytest .MonkeyPatch ,
430507 capsys : pytest .CaptureFixture [str ],
431508) -> None :
432- """Test loading via tmuxp load with -- log- file."""
509+ """Test loading with a log file."""
433510 # create dummy tmuxp yaml that breaks to prevent actually loading tmux
434511 tmuxp_config_path = tmp_path / ".tmuxp.yaml"
435512 tmuxp_config_path .write_text (
@@ -480,21 +557,18 @@ def test_load_plugins(
480557
481558@pytest .mark .skip ("Not sure how to clean up the tmux session this makes" )
482559@pytest .mark .parametrize (
483- ("cli_args" , "inputs" ),
484- [
485- (
486- ["load" , "tests/fixtures/workspace/builder/plugin_versions_fail.yaml" ],
487- ["y\n " ],
488- ),
489- ],
560+ list (PluginVersionTestFixture ._fields ),
561+ PLUGIN_VERSION_SKIP_TEST_FIXTURES ,
562+ ids = [test .test_id for test in PLUGIN_VERSION_SKIP_TEST_FIXTURES ],
490563)
491564def test_load_plugins_version_fail_skip (
492565 monkeypatch_plugin_test_packages : None ,
566+ test_id : str ,
493567 cli_args : list [str ],
494568 inputs : list [str ],
495569 capsys : pytest .CaptureFixture [str ],
496570) -> None :
497- """Test tmuxp load with plugins failing version constraints can continue ."""
571+ """Test plugin version failure with skip ."""
498572 with contextlib .suppress (SystemExit ):
499573 cli .cli (cli_args )
500574
@@ -504,22 +578,19 @@ def test_load_plugins_version_fail_skip(
504578
505579
506580@pytest .mark .parametrize (
507- ("cli_args" , "inputs" ),
508- [
509- (
510- ["load" , "tests/fixtures/workspace/builder/plugin_versions_fail.yaml" ],
511- ["n\n " ],
512- ),
513- ],
581+ list (PluginVersionTestFixture ._fields ),
582+ PLUGIN_VERSION_NO_SKIP_TEST_FIXTURES ,
583+ ids = [test .test_id for test in PLUGIN_VERSION_NO_SKIP_TEST_FIXTURES ],
514584)
515585def test_load_plugins_version_fail_no_skip (
516586 monkeypatch_plugin_test_packages : None ,
587+ test_id : str ,
517588 cli_args : list [str ],
518589 inputs : list [str ],
519590 monkeypatch : pytest .MonkeyPatch ,
520591 capsys : pytest .CaptureFixture [str ],
521592) -> None :
522- """Test tmuxp load with plugins failing version constraints can exit ."""
593+ """Test plugin version failure without skip ."""
523594 monkeypatch .setattr ("sys.stdin" , io .StringIO ("" .join (inputs )))
524595
525596 with contextlib .suppress (SystemExit ):
@@ -531,15 +602,17 @@ def test_load_plugins_version_fail_no_skip(
531602
532603
533604@pytest .mark .parametrize (
534- "cli_args" ,
535- [(["load" , "tests/fixtures/workspace/builder/plugin_missing_fail.yaml" ])],
605+ list (PluginMissingTestFixture ._fields ),
606+ PLUGIN_MISSING_TEST_FIXTURES ,
607+ ids = [test .test_id for test in PLUGIN_MISSING_TEST_FIXTURES ],
536608)
537609def test_load_plugins_plugin_missing (
538610 monkeypatch_plugin_test_packages : None ,
611+ test_id : str ,
539612 cli_args : list [str ],
540613 capsys : pytest .CaptureFixture [str ],
541614) -> None :
542- """Test tmuxp load with plugins missing raise an error ."""
615+ """Test loading with missing plugin ."""
543616 with contextlib .suppress (SystemExit ):
544617 cli .cli (cli_args )
545618
0 commit comments