summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-09-13 05:36:21 +0000
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-09-13 05:36:21 +0000
commit50e74d1aefc924a81eb8a4ce26c7376b4c41c055 (patch)
tree6b3da736cfd4e5557b9ceefa2628fcba2dced132
parentd4b44c7d2deb42b35cb3c54d8f367f16fa37e1ab (diff)
downloadpython-setuptools-git-50e74d1aefc924a81eb8a4ce26c7376b4c41c055.tar.gz
Issue #9313: Use unittest.skipUnless to skip old MSVC.
-rw-r--r--tests/test_msvc9compiler.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/tests/test_msvc9compiler.py b/tests/test_msvc9compiler.py
index 39e2c11c..ec2b2e36 100644
--- a/tests/test_msvc9compiler.py
+++ b/tests/test_msvc9compiler.py
@@ -60,7 +60,12 @@ _CLEANED_MANIFEST = """\
</dependency>
</assembly>"""
+if sys.platform=="win32":
+ from distutils.msvccompiler import get_build_version
+
@unittest.skipUnless(sys.platform=="win32", "These tests are only for win32")
+@unittest.skipUnless(get_build_version()>=8.0, "These tests are only for"
+ " MSVC8.0 or above")
class msvc9compilerTestCase(support.TempdirManager,
unittest.TestCase):
@@ -68,10 +73,6 @@ class msvc9compilerTestCase(support.TempdirManager,
# makes sure query_vcvarsall throws
# a DistutilsPlatformError if the compiler
# is not found
- from distutils.msvccompiler import get_build_version
- if get_build_version() < 8.0:
- # this test is only for MSVC8.0 or above
- return
from distutils.msvc9compiler import query_vcvarsall
def _find_vcvarsall(version):
return None
@@ -86,11 +87,6 @@ class msvc9compilerTestCase(support.TempdirManager,
msvc9compiler.find_vcvarsall = old_find_vcvarsall
def test_reg_class(self):
- from distutils.msvccompiler import get_build_version
- if get_build_version() < 8.0:
- # this test is only for MSVC8.0 or above
- return
-
from distutils.msvc9compiler import Reg
self.assertRaises(KeyError, Reg.get_value, 'xxx', 'xxx')
@@ -109,11 +105,6 @@ class msvc9compilerTestCase(support.TempdirManager,
self.assertTrue('Desktop' in keys)
def test_remove_visual_c_ref(self):
- from distutils.msvccompiler import get_build_version
- if get_build_version() < 8.0:
- # this test is only for MSVC8.0 or above
- return
-
from distutils.msvc9compiler import MSVCCompiler
tempdir = self.mkdtemp()
manifest = os.path.join(tempdir, 'manifest')