Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test runner not saving caller env correctly #644

Closed
wants to merge 1 commit into from

Conversation

@pmezard
Copy link
Contributor

@pmezard pmezard commented Aug 29, 2016

isolate() captures current env variable values, overwrites them, yields,
then restores them. Unfortunately the capturing code was broken and the
env variables were wiped out during the restore phase.

def test_env():
@click.command()
def cli_env():
click.echo('ENV={}'.format(os.environ['TEST_CLICK_ENV']))

This comment has been minimized.

isolate() captures current env variable values, overwrites them, yields,
then restores them. Unfortunately the capturing code was broken and the
env variables were wiped out during the restore phase.
@pmezard pmezard force-pushed the fix-tests-env-mocking branch from 3f36e04 to 0270282 Aug 29, 2016
@pmezard
Copy link
Contributor Author

@pmezard pmezard commented Aug 29, 2016

My bad, I was lazy and did not run tox. Tests pass here on py26, py27 and manually with py35. I pushed --force the change, tell me if you prefer I pile commits fixing review comments instead.

untitaker added a commit that referenced this issue Aug 29, 2016
@untitaker
Copy link
Member

@untitaker untitaker commented Aug 29, 2016

Applied to 6.x-maintenance and master. Thanks!

@untitaker untitaker closed this Aug 29, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants