Repository navigation
🧪 test: keep inherited PYTHONPATH in native env-files test - #290
Merged
gaborbernat merged 1 commit intoOct 27, 2026
Merged
Conversation
The unset scenarios cleared os.environ before copying PYTHONPATH and PYTHONDONTWRITEBYTECODE, so the subprocess lost both. Downstream builds that find pytest_env only through PYTHONPATH failed 12 cases, as reported in pytest-dev#275 (comment). Pass the caller's values through and add the marker only in the set scenarios.
Contributor
|
Thank you! This indeed resolves #275 (comment), which is very helpful and much appreciated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Downstream packagers who run the suite with
pytest-envreachable only throughPYTHONPATH, as Fedora'spython-pytest-envdoes, saw 12test_native_env_files_override_inicases fail after #275, as reported there. 🐧 Those cases now pass in that setup, so packagers don't need to skip them.The unset scenarios emptied the environment before copying the caller's
PYTHONPATHandPYTHONDONTWRITEBYTECODE, so the pytest subprocess could no longer import the plugin. The test now always forwards the caller's values and adds its marker path only in the set scenarios, which keeps the check that the subprocess inherits them.