[Python-checkins] r84761 - in python/branches/release31-maint: Lib/distutils/tests/test_msvc9compiler.py

hirokazu.yamamoto python-checkins at python.org
Mon Sep 13 07:48:30 CEST 2010


Author: hirokazu.yamamoto
Date: Mon Sep 13 07:48:30 2010
New Revision: 84761

Log:
Merged revisions 84753,84760 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84753 | hirokazu.yamamoto | 2010-09-13 07:55:40 +0900 | 1 line
  
  Issue #9313: Skips test_remove_visual_c_ref on old MSVC.
........
  r84760 | hirokazu.yamamoto | 2010-09-13 14:36:21 +0900 | 1 line
  
  Issue #9313: Use unittest.skipUnless to skip old MSVC.
........


Modified:
   python/branches/release31-maint/   (props changed)
   python/branches/release31-maint/Lib/distutils/tests/test_msvc9compiler.py

Modified: python/branches/release31-maint/Lib/distutils/tests/test_msvc9compiler.py
==============================================================================
--- python/branches/release31-maint/Lib/distutils/tests/test_msvc9compiler.py	(original)
+++ python/branches/release31-maint/Lib/distutils/tests/test_msvc9compiler.py	Mon Sep 13 07:48:30 2010
@@ -60,7 +60,12 @@
   </dependency>
 </assembly>"""
 
+if sys.platform=="win32":
+    from distutils.msvccompiler import get_build_version
+
 @unittest.skipUnless(sys.platform=="win32", "These tests are only for win32")
+ at 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 @@
         # 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 @@
             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')
 


More information about the Python-checkins mailing list