From a4b3363e7b7bed122b90f059e89ba096a7960c73 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Thu, 19 Mar 2020 10:46:03 +0000 Subject: [PATCH] TEST: test pass through kwargs to subprocess --- tests/test_run.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test_run.py b/tests/test_run.py index 9952c7e74..47d3a6a53 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -160,6 +160,25 @@ def test_run_tee(): assert capture.stdout == expstdout +def test_run_passthrough(): + + test_script = textwrap.dedent(""" + #!/bin/bash + + echo "env: $RUN_TEST_ENV_VAR" + """).strip() + + with tempdir.tempdir(): + + # return code == 0 + mkexec('script.sh', test_script.format(0)) + + env = {'RUN_TEST_ENV_VAR' : 'howdy ho'} + expstdout = "env: howdy ho\n" + + assert run.run('./script.sh', env=env) == expstdout + + def test_dryrun(): test_script = textwrap.dedent(""" -- GitLab