Commit 32e5fea 1 parent 5f79f22 commit 32e5fea Copy full SHA for 32e5fea
File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ def disable_macos_customization(monkeypatch):
165
165
166
166
167
167
@pytest .fixture (autouse = True , scope = "session" )
168
- def monkey_patch_get_default_compiler ():
168
+ def monkey_patch_get_default_compiler (monkeysession ):
169
169
"""
170
170
Monkey patch distutils get_default_compiler to allow overriding the
171
171
default compiler. Mainly to test mingw32 with a MSVC Python.
@@ -174,14 +174,10 @@ def monkey_patch_get_default_compiler():
174
174
175
175
default_compiler = os .environ .get ("DISTUTILS_TEST_DEFAULT_COMPILER" )
176
176
177
- if default_compiler is not None :
177
+ if default_compiler is None :
178
+ return
178
179
179
- def patched_get_default_compiler (* args , ** kwargs ):
180
- return default_compiler
180
+ def patched_getter (* args , ** kwargs ):
181
+ return default_compiler
181
182
182
- original = ccompiler .get_default_compiler
183
- ccompiler .get_default_compiler = patched_get_default_compiler
184
- yield
185
- ccompiler .get_default_compiler = original
186
- else :
187
- yield
183
+ monkeysession .setattr (ccompiler , 'get_default_compiler' , patched_getter )
You can’t perform that action at this time.
0 commit comments