summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/integration/shell.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/integration/shell.py b/tests/integration/shell.py
index 341ad7e3d..3b42e4ea0 100644
--- a/tests/integration/shell.py
+++ b/tests/integration/shell.py
@@ -75,6 +75,21 @@ def test_inherit(cli, tmpdir, datafiles, animal):
assert result.output == expected
+# Test host environment variable inheritance
+@pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
+@pytest.mark.datafiles(DATA_DIR)
+def test_inherit_again(cli, tmpdir, datafiles, animal):
+ project = os.path.join(datafiles.dirname, datafiles.basename)
+
+ # Set the env var, and expect the same with added newline
+ os.environ['ANIMAL'] = animal
+ expected = animal + '\n'
+
+ result = execute_shell(cli, project, ['echo', '${ANIMAL}'])
+ assert result.exit_code == 0
+ assert result.output == expected
+
+
# Test running an executable in a runtime with no shell (i.e., no
# /bin/sh)
@pytest.mark.datafiles(DATA_DIR)