summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_msvc9compiler.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2008-12-30 23:06:46 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2008-12-30 23:06:46 (GMT)
commite4ea6bc9f365d402faa699680500c99b08c1e26e (patch)
tree369c2b2f5b416897d15d83bedf8215938d5d5348 /Lib/distutils/tests/test_msvc9compiler.py
parentd465640eb25c0552613b3a0cb172c9cbbb141b7f (diff)
downloadcpython-e4ea6bc9f365d402faa699680500c99b08c1e26e.zip
cpython-e4ea6bc9f365d402faa699680500c99b08c1e26e.tar.gz
cpython-e4ea6bc9f365d402faa699680500c99b08c1e26e.tar.bz2
Merged revisions 68081 via svnmerge from
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 ........
Diffstat (limited to 'Lib/distutils/tests/test_msvc9compiler.py')
-rw-r--r--Lib/distutils/tests/test_msvc9compiler.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_msvc9compiler.py b/Lib/distutils/tests/test_msvc9compiler.py
new file mode 100644
index 0000000..1659cea
--- /dev/null
+++ b/Lib/distutils/tests/test_msvc9compiler.py
@@ -0,0 +1,33 @@
+"""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")