summaryrefslogtreecommitdiff
path: root/tests/unit/test_shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test_shell.py')
-rw-r--r--tests/unit/test_shell.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/unit/test_shell.py b/tests/unit/test_shell.py
index 80d63d9..543b678 100644
--- a/tests/unit/test_shell.py
+++ b/tests/unit/test_shell.py
@@ -399,14 +399,15 @@ class TestParsing(unittest.TestCase):
def setUp(self):
super(TestParsing, self).setUp()
- self._orig_environ = os.environ.copy()
+ self._environ_vars = {}
keys = os.environ.keys()
for k in keys:
- if k in ('ST_KEY', 'ST_USER', 'ST_AUTH'):
- del os.environ[k]
+ if (k in ('ST_KEY', 'ST_USER', 'ST_AUTH')
+ or k.startswith('OS_')):
+ self._environ_vars[k] = os.environ.pop(k)
def tearDown(self):
- os.environ = self._orig_environ
+ os.environ.update(self._environ_vars)
def _make_fake_command(self, result):
def fake_command(parser, args, thread_manager):