diff options
| author | Daniel Holth <dholth@fastmail.fm> | 2016-08-03 21:55:39 -0400 |
|---|---|---|
| committer | Daniel Holth <dholth@fastmail.fm> | 2016-08-03 21:55:39 -0400 |
| commit | a2605b297c147a1ad54078181d32fe369fa4f37d (patch) | |
| tree | 59786ea683feecb6ec208792d6a2086b12995842 /setuptools/tests/test_build_ext.py | |
| parent | 6a4e5446c941291ec5e7c56cee1d5a872300c955 (diff) | |
| download | python-setuptools-git-a2605b297c147a1ad54078181d32fe369fa4f37d.tar.gz | |
use abi3 extension if Extension().is_abi3
Diffstat (limited to 'setuptools/tests/test_build_ext.py')
| -rw-r--r-- | setuptools/tests/test_build_ext.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/setuptools/tests/test_build_ext.py b/setuptools/tests/test_build_ext.py index 5168ebf0..e0f2e73b 100644 --- a/setuptools/tests/test_build_ext.py +++ b/setuptools/tests/test_build_ext.py @@ -1,8 +1,10 @@ +import sys import distutils.command.build_ext as orig +from distutils.sysconfig import get_config_var from setuptools.command.build_ext import build_ext from setuptools.dist import Distribution - +from setuptools.extension import Extension class TestBuildExt: @@ -18,3 +20,19 @@ class TestBuildExt: res = cmd.get_ext_filename('foo') wanted = orig.build_ext.get_ext_filename(cmd, 'foo') assert res == wanted + + def test_abi3_filename(self): + """ + Filename needs to be loadable by several versions + of Python 3 if 'is_abi3' is truthy on Extension() + """ + dist = Distribution(dict(ext_modules=[Extension('spam.eggs', [], is_abi3=True)])) + cmd = build_ext(dist) + res = cmd.get_ext_filename('spam.eggs') + + if sys.version_info[0] == 2: + assert res.endswith(get_config_var('SO')) + elif sys.platform == 'win32': + assert res.endswith('eggs.pyd') + else: + assert 'abi3' in res
\ No newline at end of file |
