@@ -407,11 +407,12 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
407
407
408
408
409
409
@pytest .mark .parametrize (
410
- "cli_args,inputs,expected_output" ,
410
+ "cli_args,inputs,env, expected_output" ,
411
411
[
412
412
(
413
413
['shell' , '-L{SOCKET_NAME}' , '-c' , 'print(str(server.socket_name))' ],
414
414
[],
415
+ {},
415
416
'{SERVER_SOCKET_NAME}' ,
416
417
),
417
418
(
@@ -423,6 +424,7 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
423
424
'print(session.name)' ,
424
425
],
425
426
[],
427
+ {},
426
428
'{SESSION_NAME}' ,
427
429
),
428
430
(
@@ -435,6 +437,7 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
435
437
'print(server.has_session(session.name))' ,
436
438
],
437
439
[],
440
+ {},
438
441
'True' ,
439
442
),
440
443
(
@@ -447,6 +450,7 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
447
450
'print(window.name)' ,
448
451
],
449
452
[],
453
+ {},
450
454
'{WINDOW_NAME}' ,
451
455
),
452
456
(
@@ -459,11 +463,25 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
459
463
'print(pane.id)' ,
460
464
],
461
465
[],
466
+ {},
467
+ '{PANE_ID}' ,
468
+ ),
469
+ (
470
+ [
471
+ 'shell' ,
472
+ '-L{SOCKET_NAME}' ,
473
+ '-c' ,
474
+ 'print(pane.id)' ,
475
+ ],
476
+ [],
477
+ {'TMUX_PANE' : '{PANE_ID}' },
462
478
'{PANE_ID}' ,
463
479
),
464
480
],
465
481
)
466
- def test_shell (cli_args , inputs , expected_output , tmpdir , monkeypatch , server , session ):
482
+ def test_shell (
483
+ cli_args , inputs , expected_output , env , tmpdir , monkeypatch , server , session
484
+ ):
467
485
monkeypatch .setenv ('HOME' , str (tmpdir ))
468
486
window_name = 'my_window'
469
487
window = session .new_window (window_name = window_name )
@@ -479,6 +497,8 @@ def test_shell(cli_args, inputs, expected_output, tmpdir, monkeypatch, server, s
479
497
)
480
498
481
499
cli_args [:] = [cli_arg .format (** template_ctx ) for cli_arg in cli_args ]
500
+ for k , v in env .items ():
501
+ monkeypatch .setenv (k , v .format (** template_ctx ))
482
502
483
503
with tmpdir .as_cwd ():
484
504
runner = CliRunner ()
0 commit comments