Skip to content

Commit e58492b

Browse files
committed
Create a fixture to patch-out compiler customization on macOS.
1 parent 9ce8a10 commit e58492b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,10 @@ def temp_home(tmp_path, monkeypatch):
152152
def fake_home(fs, monkeypatch):
153153
home = fs.create_dir('/fakehome')
154154
return _set_home(monkeypatch, pathlib.Path(home.path))
155+
156+
157+
@pytest.fixture
158+
def disable_macos_customization(monkeypatch):
159+
from distutils import sysconfig
160+
161+
monkeypatch.setattr(sysconfig, '_customize_macos', lambda: None)

distutils/tests/test_sysconfig.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ def set_executables(self, **kw):
9898
'CCSHARED': '--sc-ccshared',
9999
'LDSHARED': 'sc_ldshared',
100100
'SHLIB_SUFFIX': 'sc_shutil_suffix',
101-
# On macOS, disable _osx_support.customize_compiler()
102-
'CUSTOMIZED_OSX_COMPILER': 'True',
103101
}
104102

105103
comp = compiler()
@@ -111,6 +109,7 @@ def set_executables(self, **kw):
111109
return comp
112110

113111
@pytest.mark.skipif("get_default_compiler() != 'unix'")
112+
@pytest.mark.usefixtures('disable_macos_customization')
114113
def test_customize_compiler(self):
115114
# Make sure that sysconfig._config_vars is initialized
116115
sysconfig.get_config_vars()

0 commit comments

Comments
 (0)