]> granicus.if.org Git - python/commitdiff
test_distutils: test_build_ext uses EnvironGuard (#1458)
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 4 May 2017 16:10:09 +0000 (18:10 +0200)
committerGitHub <noreply@github.com>
Thu, 4 May 2017 16:10:09 +0000 (18:10 +0200)
Use EnvironGuard on BuildExtTestCase to save/restore os.environ, to fix the
following warning:

Warning -- os.environ was modified by test_distutils

MSVCCompiler.initialize() of distutils.msvc9compiler modifies
os.environ.

Lib/distutils/tests/test_build_ext.py

index a4494dba4cd6e0a72c3e7cfa9ce82b0599b4db45..a6d2d2eb155b6177bee99ade124de628cc3c8f3d 100644 (file)
@@ -20,6 +20,7 @@ ALREADY_TESTED = False
 
 class BuildExtTestCase(support.TempdirManager,
                        support.LoggingSilencer,
+                       support.EnvironGuard,
                        unittest.TestCase):
     def setUp(self):
         super(BuildExtTestCase, self).setUp()