Commit a1419d19 authored by Larry Hastings's avatar Larry Hastings

Merged in stevedower/cpython350 (pull request #23)

Moves distutils test import within skippable class.
parents c31b6d19 bf74f37e
...@@ -3,8 +3,6 @@ import sys ...@@ -3,8 +3,6 @@ import sys
import unittest import unittest
import os import os
import distutils._msvccompiler as _msvccompiler
from distutils.errors import DistutilsPlatformError from distutils.errors import DistutilsPlatformError
from distutils.tests import support from distutils.tests import support
from test.support import run_unittest from test.support import run_unittest
...@@ -18,6 +16,7 @@ class msvccompilerTestCase(support.TempdirManager, ...@@ -18,6 +16,7 @@ class msvccompilerTestCase(support.TempdirManager,
unittest.TestCase): unittest.TestCase):
def test_no_compiler(self): def test_no_compiler(self):
import distutils._msvccompiler as _msvccompiler
# makes sure query_vcvarsall raises # makes sure query_vcvarsall raises
# a DistutilsPlatformError if the compiler # a DistutilsPlatformError if the compiler
# is not found # is not found
...@@ -34,6 +33,7 @@ class msvccompilerTestCase(support.TempdirManager, ...@@ -34,6 +33,7 @@ class msvccompilerTestCase(support.TempdirManager,
_msvccompiler._find_vcvarsall = old_find_vcvarsall _msvccompiler._find_vcvarsall = old_find_vcvarsall
def test_compiler_options(self): def test_compiler_options(self):
import distutils._msvccompiler as _msvccompiler
# suppress path to vcruntime from _find_vcvarsall to # suppress path to vcruntime from _find_vcvarsall to
# check that /MT is added to compile options # check that /MT is added to compile options
old_find_vcvarsall = _msvccompiler._find_vcvarsall old_find_vcvarsall = _msvccompiler._find_vcvarsall
...@@ -50,6 +50,7 @@ class msvccompilerTestCase(support.TempdirManager, ...@@ -50,6 +50,7 @@ class msvccompilerTestCase(support.TempdirManager,
_msvccompiler._find_vcvarsall = old_find_vcvarsall _msvccompiler._find_vcvarsall = old_find_vcvarsall
def test_vcruntime_copy(self): def test_vcruntime_copy(self):
import distutils._msvccompiler as _msvccompiler
# force path to a known file - it doesn't matter # force path to a known file - it doesn't matter
# what we copy as long as its name is not in # what we copy as long as its name is not in
# _msvccompiler._BUNDLED_DLLS # _msvccompiler._BUNDLED_DLLS
...@@ -69,6 +70,8 @@ class msvccompilerTestCase(support.TempdirManager, ...@@ -69,6 +70,8 @@ class msvccompilerTestCase(support.TempdirManager,
_msvccompiler._find_vcvarsall = old_find_vcvarsall _msvccompiler._find_vcvarsall = old_find_vcvarsall
def test_vcruntime_skip_copy(self): def test_vcruntime_skip_copy(self):
import distutils._msvccompiler as _msvccompiler
tempdir = self.mkdtemp() tempdir = self.mkdtemp()
compiler = _msvccompiler.MSVCCompiler() compiler = _msvccompiler.MSVCCompiler()
compiler.initialize() compiler.initialize()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment