File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 14
14
15
15
16
16
class Testmsvccompiler (support .TempdirManager ):
17
- def test_no_compiler (self ):
17
+ def test_no_compiler (self , monkeypatch ):
18
18
# makes sure query_vcvarsall raises
19
19
# a DistutilsPlatformError if the compiler
20
20
# is not found
21
21
def _find_vcvarsall (plat_spec ):
22
22
return None , None
23
23
24
- old_find_vcvarsall = _msvccompiler ._find_vcvarsall
25
- _msvccompiler ._find_vcvarsall = _find_vcvarsall
26
- try :
27
- with pytest .raises (DistutilsPlatformError ):
28
- _msvccompiler ._get_vc_env (
29
- 'wont find this version' ,
30
- )
31
- finally :
32
- _msvccompiler ._find_vcvarsall = old_find_vcvarsall
24
+ monkeypatch .setattr (_msvccompiler , '_find_vcvarsall' , _find_vcvarsall )
25
+
26
+ with pytest .raises (DistutilsPlatformError ):
27
+ _msvccompiler ._get_vc_env (
28
+ 'wont find this version' ,
29
+ )
33
30
34
31
@needs_winreg
35
32
def test_get_vc_env_unicode (self ):
You can’t perform that action at this time.
0 commit comments