diff --git a/tests/test_tags.py b/tests/test_tags.py index 75d5b650e..bb39fd6d9 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -40,7 +40,13 @@ def get_abi3_suffix(): ABI3SUFFIX = get_abi3_suffix() -def test_wheel_tag(): +@pytest.fixture() +def cleanenv(monkeypatch): + # $MACOSX_DEPLOYMENT_TARGET affects the computation of the platform tag on macOS. + monkeypatch.delenv('MACOSX_DEPLOYMENT_TARGET', raising=False) + + +def test_wheel_tag(cleanenv): assert str(mesonpy._tags.Tag()) == f'{INTERPRETER}-{ABI}-{PLATFORM}' assert str(mesonpy._tags.Tag(abi='abi3')) == f'{INTERPRETER}-abi3-{PLATFORM}' @@ -112,14 +118,14 @@ def test_tag_purelib_wheel(): assert str(builder.tag) == 'py3-none-any' -def test_tag_platlib_wheel(): +def test_tag_platlib_wheel(cleanenv): builder = wheel_builder_test_factory({ 'platlib': [f'extension{SUFFIX}'], }) assert str(builder.tag) == f'{INTERPRETER}-{ABI}-{PLATFORM}' -def test_tag_stable_abi(): +def test_tag_stable_abi(cleanenv): builder = wheel_builder_test_factory({ 'platlib': [f'extension{ABI3SUFFIX}'], }, limited_api=True) @@ -130,7 +136,7 @@ def test_tag_stable_abi(): @pytest.mark.xfail(sys.version_info < (3, 8) and sys.platform == 'win32', reason='Extension modules suffix without ABI tags') @pytest.mark.xfail('__pypy__' in sys.builtin_module_names, reason='PyPy does not support the stable ABI') -def test_tag_mixed_abi(): +def test_tag_mixed_abi(cleanenv): builder = wheel_builder_test_factory({ 'platlib': [f'extension{ABI3SUFFIX}', f'another{SUFFIX}'], }, pure=False, limited_api=True)