Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions tests/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Loading