aboutsummaryrefslogtreecommitdiffstats
path: root/test/gtest_env_var_test.py
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-02-15 21:31:41 +0000
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-02-15 21:31:41 +0000
commit6f50ccf32c31cb6e287cdfee149429ac3029bbdb (patch)
tree9324bea98a767ee2eca3f4d738aa1c0f80b9033e /test/gtest_env_var_test.py
parent9d965bbeefdd8e309e23145b1b475a0961e108a7 (diff)
downloadgoogletest-6f50ccf32c31cb6e287cdfee149429ac3029bbdb.tar.gz
googletest-6f50ccf32c31cb6e287cdfee149429ac3029bbdb.tar.bz2
googletest-6f50ccf32c31cb6e287cdfee149429ac3029bbdb.zip
Google Test's Python tests now pass on Solaris.
Diffstat (limited to 'test/gtest_env_var_test.py')
-rwxr-xr-xtest/gtest_env_var_test.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/gtest_env_var_test.py b/test/gtest_env_var_test.py
index f8250d4c..bcc0bfd5 100755
--- a/test/gtest_env_var_test.py
+++ b/test/gtest_env_var_test.py
@@ -42,6 +42,8 @@ IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_env_var_test_')
+environ = os.environ.copy()
+
def AssertEq(expected, actual):
if expected != actual:
@@ -54,9 +56,9 @@ def SetEnvVar(env_var, value):
"""Sets the env variable to 'value'; unsets it when 'value' is None."""
if value is not None:
- os.environ[env_var] = value
- elif env_var in os.environ:
- del os.environ[env_var]
+ environ[env_var] = value
+ elif env_var in environ:
+ del environ[env_var]
def GetFlag(flag):
@@ -65,7 +67,7 @@ def GetFlag(flag):
args = [COMMAND]
if flag is not None:
args += [flag]
- return gtest_test_utils.Subprocess(args).output
+ return gtest_test_utils.Subprocess(args, env=environ).output
def TestFlag(flag, test_val, default_val):