Skip to content

Commit f95a3cb

Browse files
committed
TST: add a regression test
1 parent 1ec935a commit f95a3cb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

setuptools/tests/test_build_ext.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,17 @@ def C(file):
178178
assert example_stub.startswith(f"{build_lib}/mypkg/__pycache__/ext1")
179179
assert example_stub.endswith(".pyc")
180180

181+
def test_finalize_options_multiple_call(self):
182+
"""
183+
Regression test. Check that calling build_ext.finalize_options
184+
more than once doesn't raise an exception.
185+
"""
186+
extension = Extension('spam.eggs', ['eggs.c'], py_limited_api=True)
187+
dist = Distribution(dict(ext_modules=[extension]))
188+
cmd = build_ext(dist)
189+
cmd.finalize_options()
190+
cmd.finalize_options()
191+
181192

182193
class TestBuildExtInplace:
183194
def get_build_ext_cmd(self, optional: bool, **opts) -> build_ext:

0 commit comments

Comments
 (0)