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

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.

Copy link
@untitaker

untitaker Aug 29, 2016

Member

We have to run under Python 2.6, so please change this to 'ENV=%s' % os.environ['TEST_CLICK_ENV']

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 pmezard:fix-tests-env-mocking branch from 3f36e04 to 0270282 Aug 29, 2016
@pmezard

This comment has been minimized.

Copy link
Contributor Author

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 pull request Aug 29, 2016
@untitaker

This comment has been minimized.

Copy link
Member

commented Aug 29, 2016

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

@untitaker untitaker closed this Aug 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.