Skip to content

Commit 2ef41a9

Browse files
committed
Merged in stevedower/cpython350 (pull request #23)
Moves distutils test import within skippable class.
2 parents 800000a + 26aefce commit 2ef41a9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/distutils/tests/test_msvccompiler.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import unittest
44
import os
55

6-
import distutils._msvccompiler as _msvccompiler
7-
86
from distutils.errors import DistutilsPlatformError
97
from distutils.tests import support
108
from test.support import run_unittest
@@ -18,6 +16,7 @@ class msvccompilerTestCase(support.TempdirManager,
1816
unittest.TestCase):
1917

2018
def test_no_compiler(self):
19+
import distutils._msvccompiler as _msvccompiler
2120
# makes sure query_vcvarsall raises
2221
# a DistutilsPlatformError if the compiler
2322
# is not found
@@ -34,6 +33,7 @@ def _find_vcvarsall(plat_spec):
3433
_msvccompiler._find_vcvarsall = old_find_vcvarsall
3534

3635
def test_compiler_options(self):
36+
import distutils._msvccompiler as _msvccompiler
3737
# suppress path to vcruntime from _find_vcvarsall to
3838
# check that /MT is added to compile options
3939
old_find_vcvarsall = _msvccompiler._find_vcvarsall
@@ -50,6 +50,7 @@ def _find_vcvarsall(plat_spec):
5050
_msvccompiler._find_vcvarsall = old_find_vcvarsall
5151

5252
def test_vcruntime_copy(self):
53+
import distutils._msvccompiler as _msvccompiler
5354
# force path to a known file - it doesn't matter
5455
# what we copy as long as its name is not in
5556
# _msvccompiler._BUNDLED_DLLS
@@ -69,6 +70,8 @@ def _find_vcvarsall(plat_spec):
6970
_msvccompiler._find_vcvarsall = old_find_vcvarsall
7071

7172
def test_vcruntime_skip_copy(self):
73+
import distutils._msvccompiler as _msvccompiler
74+
7275
tempdir = self.mkdtemp()
7376
compiler = _msvccompiler.MSVCCompiler()
7477
compiler.initialize()

0 commit comments

Comments
 (0)