@@ -387,7 +387,14 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
387387 assert 'Please set' not in result .output
388388
389389
390- @pytest .mark .parametrize ("cli_args" , [(['convert' , '.' ]), (['convert' , '.tmuxp.yaml' ])])
390+ @pytest .mark .parametrize (
391+ "cli_args" ,
392+ [
393+ (['convert' , '.' ]),
394+ (['convert' , '.tmuxp.yaml' ]),
395+ (['convert' , '.tmuxp.yaml' , '-y' ]),
396+ ],
397+ )
391398def test_convert (cli_args , tmpdir , monkeypatch ):
392399 # create dummy tmuxp yaml so we don't get yelled at
393400 tmpdir .join ('.tmuxp.yaml' ).write (
@@ -401,7 +408,10 @@ def test_convert(cli_args, tmpdir, monkeypatch):
401408 with tmpdir .as_cwd ():
402409 runner = CliRunner ()
403410
404- runner .invoke (cli .cli , cli_args , input = 'y\n y\n ' )
411+ # If autoconfirm (-y) no need to prompt y
412+ input_args = 'y\n y\n ' if '-y' not in cli_args else ''
413+
414+ runner .invoke (cli .cli , cli_args , input = input_args )
405415 assert tmpdir .join ('.tmuxp.json' ).check ()
406416 assert tmpdir .join ('.tmuxp.json' ).open ().read () == json .dumps (
407417 {'session_name' : 'hello' }, indent = 2
0 commit comments