Bug 1416052 - Fixup for test_clobber.py; r=me
authorGregory Szorc <gps@mozilla.com>
Tue, 14 Nov 2017 16:08:35 -0800
changeset 436396 b19b455ae87a23f8e9a84b9541f01dfbe20ed8e8
parent 436395 d7c5faf9f301505325b4a88b6831c72db2b1adbb
child 436397 9ccc25047469c3ccfaaa3a13c5e08595b3f31065
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersme
bugs1416052
milestone59.0a1
Bug 1416052 - Fixup for test_clobber.py; r=me Forgot to push the updated patch to review. Test-only change. So self-reviewing. CLOSED TREE
python/mozbuild/mozbuild/test/controller/test_clobber.py
--- a/python/mozbuild/mozbuild/test/controller/test_clobber.py
+++ b/python/mozbuild/mozbuild/test/controller/test_clobber.py
@@ -4,38 +4,42 @@
 
 from __future__ import unicode_literals
 
 import os
 import shutil
 import tempfile
 import unittest
 
-from StringIO import StringIO
-
 from mozunit import main
 
 from mozbuild.base import (
     MozbuildObject,
 )
 from mozbuild.controller.building import (
     BuildDriver,
 )
 from mozbuild.controller.clobber import (
     Clobberer,
 )
 
 
 class TestClobberer(unittest.TestCase):
     def setUp(self):
         self._temp_dirs = []
+        self._old_env = dict(os.environ)
+        os.environ.pop('MOZCONFIG', None)
+        os.environ.pop('MOZ_OBJDIR', None)
 
         return unittest.TestCase.setUp(self)
 
     def tearDown(self):
+        os.environ.clear()
+        os.environ.update(self._old_env)
+
         for d in self._temp_dirs:
             shutil.rmtree(d, ignore_errors=True)
 
         return unittest.TestCase.tearDown(self)
 
     def get_tempdir(self):
         t = tempfile.mkdtemp()
         self._temp_dirs.append(t)