Skip to content

gh-158445: Add C API tests on build information functions - #158603

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:testcapi_build
Oct 2, 2026
Merged

vstinner merged 2 commits into
python:mainfrom
vstinner:testcapi_build

Conversation

@vstinner

@vstinner vstinner commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Add tests on functions:

  • Py_GetBuildInfo()
  • Py_GetCompiler()
  • Py_GetCopyright()
  • Py_GetPlatform()
  • Py_GetVersion()

Changes:

  • Add Modules/_testlimitedcapi.c and Lib/test/test_capi/test_build.py files.
  • Add internal _Py_GetBuiltWithAssert() function.
  • Reimplemenet support.built_with_c_assertions() using _Py_GetBuiltWithAssert() to cover more cases like buildbots using CFLAGS=-UNDEBUG in release mode.

Add tests on functions:

* Py_GetBuildInfo()
* Py_GetCompiler()
* Py_GetCopyright()
* Py_GetPlatform()
* Py_GetVersion()

Changes:

* Add Modules/_testlimitedcapi.c and
  Lib/test/test_capi/test_build.py files.
* Add internal _Py_GetBuiltWithAssert() function.
* Reimplemenet support.built_with_c_assertions() using
  _Py_GetBuiltWithAssert() to cover more cases like buildbots using
  CFLAGS=-UNDEBUG in release mode.
@vstinner vstinner changed the title Add C API tests on build information functions gh-158445: Add C API tests on build information functions Oct 2, 2026
@vstinner
vstinner enabled auto-merge (squash) October 2, 2026 14:31
@vstinner
vstinner merged commit a831abb into python:main Oct 2, 2026
51 checks passed
@vstinner
vstinner deleted the testcapi_build branch October 2, 2026 14:43
@vstinner

vstinner commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

Follow-up: #158608 allocates Py_GetVersion() on the heap memory to no longer truncate long versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant