Skip to content

Commit e51af1c

Browse files
committed
Clarifying something
1 parent 5ce38c9 commit e51af1c

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

tests/fixtures/workspace/builder/environment_vars.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ session_name: test env vars
22
start_directory: '~'
33
environment:
44
FOO: SESSION
5+
BAR: SESSION
56
PATH: /tmp
67
options:
78
default-shell: /bin/sh
@@ -25,3 +26,11 @@ windows:
2526
- pane
2627
- environment:
2728
FOO: PANE
29+
- pane
30+
- window_name: partial_overrides
31+
environment:
32+
FOO: WINDOW
33+
BAR: WINDOW
34+
panes:
35+
- environment:
36+
FOO: PANE

tests/workspace/test_builder.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,14 @@ def test_environment_variables(session):
371371
pane.send_keys("echo $FOO")
372372
assert pane.capture_pane()[1] == "PANE"
373373

374+
partial_overrides_win = session.windows[4]
375+
pane = partial_overrides_win.panes[0]
376+
pane.send_keys("echo $FOO")
377+
assert pane.capture_pane()[1] == "PANE"
378+
pane.send_keys("echo $BAR")
379+
# TODO: Currently this is SESSION, but WINDOW could be expected as well.
380+
assert pane.capture_pane()[3] == "SESSION"
381+
374382

375383
@pytest.mark.skipif(
376384
has_gte_version("3.0"),
@@ -396,15 +404,15 @@ def test_environment_variables_logs(session: Session, caplog: pytest.LogCaptureF
396404
for record in caplog.records
397405
if "Cannot set environment for new window." in record.msg
398406
)
399-
== 4
407+
== 5
400408
), "Warning on creating windows missing"
401409
assert (
402410
sum(
403411
1
404412
for record in caplog.records
405413
if "Cannot set environment for new pane." in record.msg
406414
)
407-
== 1
415+
== 2
408416
), "Warning on creating panes missing"
409417

410418

0 commit comments

Comments
 (0)