Skip to content
Myr

Merge branch '6.x-maintenance'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parents 764541f, 501b641 · Browse files · 3 files+21 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+21 added−1 removed

  • tests:+19 added−0 removed
  • other:+2 added−1 removed

3 files+21 added−1 removed

modified:click/testing.py+1 added-1 removed
211 unmodified lines
212213 old_env = {}214 try:215 for key, value in iteritems(env):216 old_env[key] = os.environ.get(value)216 old_env[key] = os.environ.get(key)217 if value is None:218 try:219 del os.environ[key]220 except Exception:
102 unmodified lines
modified:tests/test_testing.py+19 added
1import os2import sys34import pytest5import click
177 unmodified lines
183184 result = runner.invoke(cli_no_error)185 assert result.exit_code == 0186 assert result.output == 'hello world\n'187188189def test_env():190 @click.command()191 def cli_env():192 click.echo('ENV=%s' % os.environ['TEST_CLICK_ENV'])193194 runner = CliRunner()195196 env_orig = dict(os.environ)197 env = dict(env_orig)198 assert 'TEST_CLICK_ENV' not in env199 env['TEST_CLICK_ENV'] = 'some_value'200 result = runner.invoke(cli_env, env=env)201 assert result.exit_code == 0202 assert result.output == 'ENV=some_value\n'203204 assert os.environ == env_orig
modified:CHANGES+1 added
19 unmodified lines
20(bugfix release; yet to be released)2122- Make `click.progressbar` work with `codecs.open` files. See #637.23- Fix bug in bash completion with nested subcommands. See #639.24- Fix test runner not saving caller env correctly. See #644.2526Version 6.627-----------28
331 unmodified lines