@@ -76,12 +76,12 @@ def test_vcruntime_skip_copy(self):
7676 compiler = _msvccompiler .MSVCCompiler ()
7777 compiler .initialize ()
7878 dll = compiler ._vcruntime_redist
79- self .assertTrue (os .path .isfile (dll ))
79+ self .assertTrue (os .path .isfile (dll ), dll or "<None>" )
8080
8181 compiler ._copy_vcruntime (tempdir )
8282
8383 self .assertFalse (os .path .isfile (os .path .join (
84- tempdir , os .path .basename (dll ))))
84+ tempdir , os .path .basename (dll ))), dll or "<None>" )
8585
8686 def test_get_vc_env_unicode (self ):
8787 import distutils ._msvccompiler as _msvccompiler
@@ -101,6 +101,30 @@ def test_get_vc_env_unicode(self):
101101 if old_distutils_use_sdk :
102102 os .environ ['DISTUTILS_USE_SDK' ] = old_distutils_use_sdk
103103
104+ def test_get_vc2017 (self ):
105+ import distutils ._msvccompiler as _msvccompiler
106+
107+ # This function cannot be mocked, so pass it if we find VS 2017
108+ # and mark it skipped if we do not.
109+ version , path = _msvccompiler ._find_vc2017 ()
110+ if version :
111+ self .assertGreaterEqual (version , 15 )
112+ self .assertTrue (os .path .isdir (path ))
113+ else :
114+ raise unittest .SkipTest ("VS 2017 is not installed" )
115+
116+ def test_get_vc2015 (self ):
117+ import distutils ._msvccompiler as _msvccompiler
118+
119+ # This function cannot be mocked, so pass it if we find VS 2015
120+ # and mark it skipped if we do not.
121+ version , path = _msvccompiler ._find_vc2015 ()
122+ if version :
123+ self .assertGreaterEqual (version , 14 )
124+ self .assertTrue (os .path .isdir (path ))
125+ else :
126+ raise unittest .SkipTest ("VS 2015 is not installed" )
127+
104128def test_suite ():
105129 return unittest .makeSuite (msvccompilerTestCase )
106130
0 commit comments