This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-ponymail-unit-tests.git

commit 229c160937ea322b3199ab0d5623b67f0f47314e
Author: Sebb <[email protected]>
AuthorDate: Sun Aug 30 23:07:54 2020 +0100

    Allow environment to be overridden
---
 runall.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/runall.py b/runall.py
index 229970b..9bac2c5 100755
--- a/runall.py
+++ b/runall.py
@@ -41,10 +41,14 @@ if __name__ == '__main__':
     for spec_file in spec_files:
         with open(spec_file, 'r') as f:
             yml = yaml.safe_load(f)
-            env = None # Environment variable override, e.g. MOCK_GMTIME
+            env = os.environ # always pass parent environ
             for test_type in yml:
                 if test_type == 'args':
-                    env = yml[test_type].get("env", None)
+                     # Environment variable override, e.g. MOCK_GMTIME
+                    env_ = yml[test_type].get("env", None)
+                    if env_:
+                        for key, val in env_.items():
+                            env[key] = val
                     continue
                 tests_total += 1
                 print("Running '%s' tests from %s..." % (test_type, spec_file))

Reply via email to