summaryrefslogtreecommitdiff
path: root/setuptools
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-12 15:44:23 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-12 16:00:16 +0100
commit4eff1adc04d2a91d60cd4e6d7ef36e3a79460cb5 (patch)
tree79a0d9f451b70902fba203bdcb8b0f04585c3686 /setuptools
parent490d640526fc9d7a8cd59939d9904709eac041b6 (diff)
downloadpython-setuptools-git-4eff1adc04d2a91d60cd4e6d7ef36e3a79460cb5.tar.gz
Replicate error in issue 3510
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/tests/test_build_ext.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/setuptools/tests/test_build_ext.py b/setuptools/tests/test_build_ext.py
index 07ebcaf8..1e3aea20 100644
--- a/setuptools/tests/test_build_ext.py
+++ b/setuptools/tests/test_build_ext.py
@@ -31,6 +31,26 @@ class TestBuildExt:
wanted = orig.build_ext.get_ext_filename(cmd, 'foo')
assert res == wanted
+ def test_optional_inplace(self, tmpdir_cwd, capsys):
+ # If optional extensions fail to build, setuptools should show the error
+ # in the logs but not fail to build
+ files = {
+ "eggs.c": "#include missingheader.h\n",
+ ".build": {"lib": {}, "tmp": {}},
+ }
+ path.build(files)
+ extension = Extension('spam.eggs', ['eggs.c'], optional=True)
+ dist = Distribution(dict(ext_modules=[extension]))
+ dist.script_name = 'setup.py'
+ cmd = build_ext(dist)
+ vars(cmd).update(build_lib=".build/lib", build_temp=".build/tmp", inplace=True)
+ cmd.ensure_finalized()
+ cmd.run()
+ logs = capsys.readouterr()
+ messages = (logs.out + logs.err)
+ assert 'build_ext: building extension "spam.eggs" failed' in messages
+ # No exception should be raised
+
def test_abi3_filename(self):
"""
Filename needs to be loadable by several versions