bpo-32942: Fix environment dependent test_script_helper#8034
Conversation
result of function interpreter_requires_environment depends on os.environ - this was not covered by the tests, leading to fail in some environments
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. When your account is ready, please add a comment in this pull request Thanks again for your contribution, we look forward to reviewing it! |
terryjreedy
left a comment
There was a problem hiding this comment.
I approve of patch changes text_script_helper result from failure to success ;-). I leave review of detail and merge decision to Victor -- after CLA is signed.
vstinner
left a comment
There was a problem hiding this comment.
Don't forget to sign the CLA. Otherwise, we cannot merge your PR.
| # Reset the private cached state. | ||
| script_helper.__dict__['__cached_interp_requires_environment'] = None | ||
|
|
||
| @mock.patch('os.environ', {}) |
There was a problem hiding this comment.
I would prefer to only modify add/remove variables needed by the function, instead of using a strange empty environment.
There was a problem hiding this comment.
Know what you mean, I'm on it.
|
@LorenzMende: Can you please sign the CLA? See #8034 (comment) for details. |
|
@vstinner: Missed one step in the CLA procedure... should be fine now. |
|
Thanks @LorenzMende for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
|
Thanks @LorenzMende for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
|
GH-8087 is a backport of this pull request to the 3.7 branch. |
Result of function interpreter_requires_environment() depends on os.environ. This was not covered by the tests, leading to fail when PYTHONHOME was set. (cherry picked from commit a390cb6) Co-authored-by: Lorenz Mende <Lorenz.mende@gmail.com>
Result of function interpreter_requires_environment() depends on os.environ. This was not covered by the tests, leading to fail when PYTHONHOME was set. (cherry picked from commit a390cb6) Co-authored-by: Lorenz Mende <Lorenz.mende@gmail.com>
|
GH-8088 is a backport of this pull request to the 3.6 branch. |
Result of function interpreter_requires_environment() depends on os.environ. This was not covered by the tests, leading to fail when PYTHONHOME was set. (cherry picked from commit a390cb6) Co-authored-by: Lorenz Mende <Lorenz.mende@gmail.com>
Result of function interpreter_requires_environment() depends on os.environ. This was not covered by the tests, leading to fail when PYTHONHOME was set. (cherry picked from commit a390cb6) Co-authored-by: Lorenz Mende <Lorenz.mende@gmail.com>
result of function interpreter_requires_environment depends on os.environ - this was not covered by the tests, leading to fail in some environments
3 tests modified, 1 added
https://bugs.python.org/issue32942