Skip to content

bpo-32942: Fix environment dependent test_script_helper#8034

Merged
vstinner merged 2 commits into
python:masterfrom
LorenzMende:bpo-32942
Jul 4, 2018
Merged

bpo-32942: Fix environment dependent test_script_helper#8034
vstinner merged 2 commits into
python:masterfrom
LorenzMende:bpo-32942

Conversation

@LorenzMende

@LorenzMende LorenzMende commented Jun 30, 2018

Copy link
Copy Markdown
Contributor

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

result of function interpreter_requires_environment depends on os.environ - this was not covered by the tests, leading to fail in some environments
@the-knights-who-say-ni

Copy link
Copy Markdown

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
and a Python core developer will remove the CLA not signed label
to make the bot check again.

Thanks again for your contribution, we look forward to reviewing it!

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to sign the CLA. Otherwise, we cannot merge your PR.

Comment thread Lib/test/test_script_helper.py Outdated
# Reset the private cached state.
script_helper.__dict__['__cached_interp_requires_environment'] = None

@mock.patch('os.environ', {})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to only modify add/remove variables needed by the function, instead of using a strange empty environment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Know what you mean, I'm on it.

@vstinner

vstinner commented Jul 2, 2018

Copy link
Copy Markdown
Member

@LorenzMende: Can you please sign the CLA? See #8034 (comment) for details.

@LorenzMende

Copy link
Copy Markdown
Contributor Author

@vstinner: Missed one step in the CLA procedure... should be fine now.

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @LorenzMende for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @LorenzMende for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@bedevere-bot

Copy link
Copy Markdown

GH-8087 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 4, 2018
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>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 4, 2018
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>
@bedevere-bot

Copy link
Copy Markdown

GH-8088 is a backport of this pull request to the 3.6 branch.

miss-islington added a commit that referenced this pull request Jul 4, 2018
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>
miss-islington added a commit that referenced this pull request Jul 4, 2018
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>
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.

6 participants