mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	 9df8ce3a8f
			
		
	
	
		9df8ce3a8f
		
	
	
	
	
		
			
			svn+ssh://pythondev@svn.python.org/python/trunk ........ r68081 | tarek.ziade | 2008-12-31 00:03:41 +0100 (Wed, 31 Dec 2008) | 1 line Fixed #4702: Throwing DistutilsPlatformError instead of IOError under win32 if MSVC is not found ........
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| """Tests for distutils.msvc9compiler."""
 | |
| import sys
 | |
| import unittest
 | |
| 
 | |
| from distutils.errors import DistutilsPlatformError
 | |
| 
 | |
| class msvc9compilerTestCase(unittest.TestCase):
 | |
| 
 | |
|     def test_no_compiler(self):
 | |
|         # makes sure query_vcvarsall throws
 | |
|         # a DistutilsPlatformError if the compiler
 | |
|         # is not found
 | |
|         if sys.platform != 'win32':
 | |
|             # this test is only for win32
 | |
|             return
 | |
|         from distutils.msvc9compiler import query_vcvarsall
 | |
|         def _find_vcvarsall(version):
 | |
|             return None
 | |
| 
 | |
|         from distutils import msvc9compiler
 | |
|         old_find_vcvarsall = msvc9compiler.find_vcvarsall
 | |
|         msvc9compiler.find_vcvarsall = _find_vcvarsall
 | |
|         try:
 | |
|             self.assertRaises(DistutilsPlatformError, query_vcvarsall,
 | |
|                              'wont find this version')
 | |
|         finally:
 | |
|             msvc9compiler.find_vcvarsall = old_find_vcvarsall
 | |
| 
 | |
| def test_suite():
 | |
|     return unittest.makeSuite(msvc9compilerTestCase)
 | |
| 
 | |
| if __name__ == "__main__":
 | |
|     unittest.main(defaultTest="test_suite")
 |