Skip to content

gh-151096: Fix test_embed with split exec prefix#151288

Open
harjothkhara wants to merge 2 commits into
python:mainfrom
harjothkhara:gh-151096-test-embed-split-prefix
Open

gh-151096: Fix test_embed with split exec prefix#151288
harjothkhara wants to merge 2 commits into
python:mainfrom
harjothkhara:gh-151096-test-embed-split-prefix

Conversation

@harjothkhara

@harjothkhara harjothkhara commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Fix test_init_is_python_build_with_home for builds configured with different --prefix and --exec-prefix.

When running from the build directory on POSIX, getpath uses PREFIX for prefix/base_prefix and EXEC_PREFIX for exec_prefix/base_exec_prefix. The test assumed both match sys.prefix, which fails on a split-prefix build. This also fixes the module_search_paths() helper so its default exec_prefix comes from the expected config's exec_prefix rather than prefix.

Verified with a local split-prefix build (--prefix=… --exec-prefix=…/exec): the targeted test failed before and passes after, and full test_embed passes. Tests-only change.

Disclosure: AI-assisted; I've reviewed it.

@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jun 10, 2026
@harjothkhara harjothkhara marked this pull request as ready for review June 10, 2026 23:09
@harjothkhara

harjothkhara commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@vstinner, this is a small test-only fix in test_embed: this makes test_init_is_python_build_with_home pass with split --prefix / --exec-prefix builds. Would you mind taking a quick look?

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

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant