commit python3-click for openSUSE:Factory
Hello community, here is the log from the commit of package python3-click for openSUSE:Factory checked in at 2017-01-25 23:25:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-click (Old) and /work/SRC/openSUSE:Factory/.python3-click.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python3-click" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-click/python3-click.changes 2016-09-25 14:42:15.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3-click.new/python3-click.changes 2017-01-25 23:25:56.395215302 +0100 @@ -1,0 +2,14 @@ +Wed Jan 18 03:31:32 UTC 2017 - arun@gmx.de + +- specfile: + * update copyright year + +- update to version 6.7: + * Make `click.progressbar` work with `codecs.open` files. See #637. + * Fix bug in bash completion with nested subcommands. See #639. + * Fix test runner not saving caller env correctly. See #644. + * Fix handling of SIGPIPE. See #626 + * Deal with broken Windows environments such as Google App + Engine's. See #711. + +------------------------------------------------------------------- @@ -11 +24,0 @@ - Old: ---- click-6.6.tar.gz New: ---- click-6.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-click.spec ++++++ --- /var/tmp/diff_new_pack.Phu3Yr/_old 2017-01-25 23:25:56.859145358 +0100 +++ /var/tmp/diff_new_pack.Phu3Yr/_new 2017-01-25 23:25:56.863144755 +0100 @@ -1,7 +1,7 @@ # # spec file for package python3-click # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python3-click -Version: 6.6 +Version: 6.7 Release: 0 Summary: A simple wrapper around optparse for powerful command line utilities License: BSD-3-Clause @@ -25,8 +25,8 @@ Url: http://github.com/mitsuhiko/click Source: https://files.pythonhosted.org/packages/source/c/click/click-%{version}.tar.gz BuildRequires: python3-devel -BuildRequires: python3-setuptools BuildRequires: python3-pytest +BuildRequires: python3-setuptools BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch ++++++ click-6.6.tar.gz -> click-6.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/CHANGES new/click-6.7/CHANGES --- old/click-6.6/CHANGES 2016-04-04 18:49:35.000000000 +0200 +++ new/click-6.7/CHANGES 2017-01-06 23:40:17.000000000 +0100 @@ -3,6 +3,17 @@ This contains all major version changes between Click releases. +Version 6.7 +----------- + +(bugfix release; released on January 6th 2017) + +- Make `click.progressbar` work with `codecs.open` files. See #637. +- Fix bug in bash completion with nested subcommands. See #639. +- Fix test runner not saving caller env correctly. See #644. +- Fix handling of SIGPIPE. See #626 +- Deal with broken Windows environments such as Google App Engine's. See #711. + Version 6.6 ----------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/PKG-INFO new/click-6.7/PKG-INFO --- old/click-6.6/PKG-INFO 2016-04-04 18:51:33.000000000 +0200 +++ new/click-6.7/PKG-INFO 2017-01-06 23:41:11.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: click -Version: 6.6 +Version: 6.7 Summary: A simple wrapper around optparse for powerful command line utilities. Home-page: http://github.com/mitsuhiko/click Author: Armin Ronacher diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/click/__init__.py new/click-6.7/click/__init__.py --- old/click-6.6/click/__init__.py 2016-04-04 18:50:46.000000000 +0200 +++ new/click-6.7/click/__init__.py 2017-01-06 23:40:55.000000000 +0100 @@ -95,4 +95,4 @@ disable_unicode_literals_warning = False -__version__ = '6.6' +__version__ = '6.7' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/click/_bashcomplete.py new/click-6.7/click/_bashcomplete.py --- old/click-6.6/click/_bashcomplete.py 2016-04-04 18:27:24.000000000 +0200 +++ new/click-6.7/click/_bashcomplete.py 2016-12-01 13:33:48.000000000 +0100 @@ -30,8 +30,8 @@ def resolve_ctx(cli, prog_name, args): ctx = cli.make_context(prog_name, args, resilient_parsing=True) - while ctx.args + ctx.protected_args and isinstance(ctx.command, MultiCommand): - a = ctx.args + ctx.protected_args + while ctx.protected_args + ctx.args and isinstance(ctx.command, MultiCommand): + a = ctx.protected_args + ctx.args cmd = ctx.command.get_command(ctx, a[0]) if cmd is None: return None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/click/_compat.py new/click-6.7/click/_compat.py --- old/click-6.6/click/_compat.py 2016-04-04 18:47:57.000000000 +0200 +++ new/click-6.7/click/_compat.py 2017-01-06 23:39:09.000000000 +0100 @@ -160,8 +160,16 @@ # # This code also lives in _winconsole for the fallback to the console # emulation stream. - if WIN: + # + # There are also Windows environments where the `msvcrt` module is not + # available (which is why we use try-catch instead of the WIN variable + # here), such as the Google App Engine development server on Windows. In + # those cases there is just nothing we can do. + try: import msvcrt + except ImportError: + set_binary_mode = lambda x: x + else: def set_binary_mode(f): try: fileno = f.fileno() @@ -170,8 +178,6 @@ else: msvcrt.setmode(fileno, os.O_BINARY) return f - else: - set_binary_mode = lambda x: x def isidentifier(x): return _identifier_re.search(x) is not None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/click/_termui_impl.py new/click-6.7/click/_termui_impl.py --- old/click-6.6/click/_termui_impl.py 2016-04-04 18:47:57.000000000 +0200 +++ new/click-6.7/click/_termui_impl.py 2017-01-06 23:32:37.000000000 +0100 @@ -31,7 +31,7 @@ """Returns the length hint of an object.""" try: return len(obj) - except TypeError: + except (AttributeError, TypeError): try: get_hint = type(obj).__length_hint__ except AttributeError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/click/_unicodefun.py new/click-6.7/click/_unicodefun.py --- old/click-6.6/click/_unicodefun.py 2016-04-04 18:47:57.000000000 +0200 +++ new/click-6.7/click/_unicodefun.py 2017-01-06 23:32:37.000000000 +0100 @@ -114,6 +114,5 @@ raise RuntimeError('Click will abort further execution because Python 3 ' 'was configured to use ASCII as encoding for the ' - 'environment. Either run this under Python 2 or ' - 'consult http://click.pocoo.org/python3/ for ' - 'mitigation steps.' + extra) + 'environment. Consult http://click.pocoo.org/python3/' + 'for mitigation steps.' + extra) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/click/core.py new/click-6.7/click/core.py --- old/click-6.6/click/core.py 2016-04-04 18:47:57.000000000 +0200 +++ new/click-6.7/click/core.py 2017-01-06 23:32:37.000000000 +0100 @@ -1,3 +1,4 @@ +import errno import os import sys from contextlib import contextmanager @@ -705,6 +706,11 @@ raise e.show() sys.exit(e.exit_code) + except IOError as e: + if e.errno == errno.EPIPE: + sys.exit(1) + else: + raise except Abort: if not standalone_mode: raise diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/click/testing.py new/click-6.7/click/testing.py --- old/click-6.6/click/testing.py 2015-11-29 17:31:33.000000000 +0100 +++ new/click-6.7/click/testing.py 2017-01-06 23:32:37.000000000 +0100 @@ -213,7 +213,7 @@ old_env = {} try: for key, value in iteritems(env): - old_env[key] = os.environ.get(value) + old_env[key] = os.environ.get(key) if value is None: try: del os.environ[key] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/click.egg-info/PKG-INFO new/click-6.7/click.egg-info/PKG-INFO --- old/click-6.6/click.egg-info/PKG-INFO 2016-04-04 18:51:33.000000000 +0200 +++ new/click-6.7/click.egg-info/PKG-INFO 2017-01-06 23:41:11.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: click -Version: 6.6 +Version: 6.7 Summary: A simple wrapper around optparse for powerful command line utilities. Home-page: http://github.com/mitsuhiko/click Author: Armin Ronacher diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/click.egg-info/SOURCES.txt new/click-6.7/click.egg-info/SOURCES.txt --- old/click-6.6/click.egg-info/SOURCES.txt 2016-04-04 18:51:33.000000000 +0200 +++ new/click-6.7/click.egg-info/SOURCES.txt 2017-01-06 23:41:11.000000000 +0100 @@ -87,24 +87,12 @@ examples/naval/README examples/naval/naval.py examples/naval/setup.py -examples/plugins/BrokenPlugin/printer_bold.egg-info/PKG-INFO -examples/plugins/BrokenPlugin/printer_bold.egg-info/SOURCES.txt -examples/plugins/BrokenPlugin/printer_bold.egg-info/dependency_links.txt -examples/plugins/BrokenPlugin/printer_bold.egg-info/entry_points.txt -examples/plugins/BrokenPlugin/printer_bold.egg-info/top_level.txt -examples/plugins/printer.egg-info/PKG-INFO -examples/plugins/printer.egg-info/SOURCES.txt -examples/plugins/printer.egg-info/dependency_links.txt -examples/plugins/printer.egg-info/entry_points.txt -examples/plugins/printer.egg-info/top_level.txt examples/repo/README examples/repo/repo.py examples/repo/setup.py examples/termui/README examples/termui/setup.py examples/termui/termui.py -examples/termui/build/lib/termui.py -examples/termui/dist/click_example_termui-1.0-py3.4.egg examples/validation/README examples/validation/setup.py examples/validation/validation.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/plugins/BrokenPlugin/printer_bold.egg-info/PKG-INFO new/click-6.7/examples/plugins/BrokenPlugin/printer_bold.egg-info/PKG-INFO --- old/click-6.6/examples/plugins/BrokenPlugin/printer_bold.egg-info/PKG-INFO 2015-07-08 14:05:54.000000000 +0200 +++ new/click-6.7/examples/plugins/BrokenPlugin/printer_bold.egg-info/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -Metadata-Version: 1.0 -Name: printer-bold -Version: 0.1dev0 -Summary: UNKNOWN -Home-page: UNKNOWN -Author: UNKNOWN -Author-email: UNKNOWN -License: UNKNOWN -Description: UNKNOWN -Platform: UNKNOWN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/plugins/BrokenPlugin/printer_bold.egg-info/SOURCES.txt new/click-6.7/examples/plugins/BrokenPlugin/printer_bold.egg-info/SOURCES.txt --- old/click-6.6/examples/plugins/BrokenPlugin/printer_bold.egg-info/SOURCES.txt 2015-07-08 14:05:54.000000000 +0200 +++ new/click-6.7/examples/plugins/BrokenPlugin/printer_bold.egg-info/SOURCES.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ -README.rst -printer_bold/__init__.py -printer_bold/core.py -printer_bold.egg-info/PKG-INFO -printer_bold.egg-info/SOURCES.txt -printer_bold.egg-info/dependency_links.txt -printer_bold.egg-info/entry_points.txt -printer_bold.egg-info/top_level.txt \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/plugins/BrokenPlugin/printer_bold.egg-info/dependency_links.txt new/click-6.7/examples/plugins/BrokenPlugin/printer_bold.egg-info/dependency_links.txt --- old/click-6.6/examples/plugins/BrokenPlugin/printer_bold.egg-info/dependency_links.txt 2015-07-08 14:05:54.000000000 +0200 +++ new/click-6.7/examples/plugins/BrokenPlugin/printer_bold.egg-info/dependency_links.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/plugins/BrokenPlugin/printer_bold.egg-info/entry_points.txt new/click-6.7/examples/plugins/BrokenPlugin/printer_bold.egg-info/entry_points.txt --- old/click-6.6/examples/plugins/BrokenPlugin/printer_bold.egg-info/entry_points.txt 2015-07-08 14:05:54.000000000 +0200 +++ new/click-6.7/examples/plugins/BrokenPlugin/printer_bold.egg-info/entry_points.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ - - [printer.plugins] - bold=printer_bold.core:bolddddddddddd - \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/plugins/BrokenPlugin/printer_bold.egg-info/top_level.txt new/click-6.7/examples/plugins/BrokenPlugin/printer_bold.egg-info/top_level.txt --- old/click-6.6/examples/plugins/BrokenPlugin/printer_bold.egg-info/top_level.txt 2015-07-08 14:05:54.000000000 +0200 +++ new/click-6.7/examples/plugins/BrokenPlugin/printer_bold.egg-info/top_level.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -printer_bold diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/plugins/printer.egg-info/PKG-INFO new/click-6.7/examples/plugins/printer.egg-info/PKG-INFO --- old/click-6.6/examples/plugins/printer.egg-info/PKG-INFO 2015-07-08 14:05:34.000000000 +0200 +++ new/click-6.7/examples/plugins/printer.egg-info/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -Metadata-Version: 1.0 -Name: printer -Version: 0.1dev0 -Summary: UNKNOWN -Home-page: UNKNOWN -Author: UNKNOWN -Author-email: UNKNOWN -License: UNKNOWN -Description: UNKNOWN -Platform: UNKNOWN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/plugins/printer.egg-info/SOURCES.txt new/click-6.7/examples/plugins/printer.egg-info/SOURCES.txt --- old/click-6.6/examples/plugins/printer.egg-info/SOURCES.txt 2015-07-08 14:05:34.000000000 +0200 +++ new/click-6.7/examples/plugins/printer.egg-info/SOURCES.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ -README.rst -printer/__init__.py -printer/cli.py -printer.egg-info/PKG-INFO -printer.egg-info/SOURCES.txt -printer.egg-info/dependency_links.txt -printer.egg-info/entry_points.txt -printer.egg-info/top_level.txt \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/plugins/printer.egg-info/dependency_links.txt new/click-6.7/examples/plugins/printer.egg-info/dependency_links.txt --- old/click-6.6/examples/plugins/printer.egg-info/dependency_links.txt 2015-07-08 14:05:34.000000000 +0200 +++ new/click-6.7/examples/plugins/printer.egg-info/dependency_links.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/plugins/printer.egg-info/entry_points.txt new/click-6.7/examples/plugins/printer.egg-info/entry_points.txt --- old/click-6.6/examples/plugins/printer.egg-info/entry_points.txt 2015-07-08 14:05:34.000000000 +0200 +++ new/click-6.7/examples/plugins/printer.egg-info/entry_points.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ - - [console_scripts] - printer=printer.cli:cli - \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/plugins/printer.egg-info/top_level.txt new/click-6.7/examples/plugins/printer.egg-info/top_level.txt --- old/click-6.6/examples/plugins/printer.egg-info/top_level.txt 2015-07-08 14:05:34.000000000 +0200 +++ new/click-6.7/examples/plugins/printer.egg-info/top_level.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -printer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/examples/termui/build/lib/termui.py new/click-6.7/examples/termui/build/lib/termui.py --- old/click-6.6/examples/termui/build/lib/termui.py 2014-06-23 22:46:51.000000000 +0200 +++ new/click-6.7/examples/termui/build/lib/termui.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,145 +0,0 @@ -# coding: utf-8 -import click -import time -import random - -try: - range_type = xrange -except NameError: - range_type = range - - -@click.group() -def cli(): - """This script showcases different terminal UI helpers in Click.""" - pass - - -@cli.command() -def colordemo(): - """Demonstrates ANSI color support.""" - for color in 'red', 'green', 'blue': - click.echo(click.style('I am colored %s' % color, fg=color)) - click.echo(click.style('I am background colored %s' % color, bg=color)) - - -@cli.command() -def pager(): - """Demonstrates using the pager.""" - lines = [] - for x in range_type(200): - lines.append('%s. Hello World!' % click.style(str(x), fg='green')) - click.echo_via_pager('\n'.join(lines)) - - -@cli.command() -@click.option('--count', default=8000, type=click.IntRange(1, 100000), - help='The number of items to process.') -def progress(count): - """Demonstrates the progress bar.""" - items = range_type(count) - - def process_slowly(item): - time.sleep(0.002 * random.random()) - - def filter(items): - for item in items: - if random.random() > 0.3: - yield item - - with click.progressbar(items, label='Processing accounts', - fill_char=click.style('#', fg='green')) as bar: - for item in bar: - process_slowly(item) - - def show_item(item): - if item is not None: - return 'Item #%d' % item - - with click.progressbar(filter(items), label='Committing transaction', - fill_char=click.style('#', fg='yellow'), - item_show_func=show_item) as bar: - for item in bar: - process_slowly(item) - - with click.progressbar(length=count, label='Counting', - bar_template='%(label)s %(bar)s | %(info)s', - fill_char=click.style(u'█', fg='cyan'), - empty_char=' ') as bar: - for item in bar: - process_slowly(item) - - with click.progressbar(length=count, width=0, show_percent=False, - show_eta=False, - fill_char=click.style('#', fg='magenta')) as bar: - for item in bar: - process_slowly(item) - - -@cli.command() -@click.argument('url') -def open(url): - """Opens a file or URL In the default application.""" - click.launch(url) - - -@cli.command() -@click.argument('url') -def locate(url): - """Opens a file or URL In the default application.""" - click.launch(url, locate=True) - - -@cli.command() -def edit(): - """Opens an editor with some text in it.""" - MARKER = '# Everything below is ignored\n' - message = click.edit('\n\n' + MARKER) - if message is not None: - msg = message.split(MARKER, 1)[0].rstrip('\n') - if not msg: - click.echo('Empty message!') - else: - click.echo('Message:\n' + msg) - else: - click.echo('You did not enter anything!') - - -@cli.command() -def clear(): - """Clears the entire screen.""" - click.clear() - - -@cli.command() -def pause(): - """Waits for the user to press a button.""" - click.pause() - - -@cli.command() -def menu(): - """Shows a simple menu.""" - menu = 'main' - while 1: - if menu == 'main': - click.echo('Main menu:') - click.echo(' d: debug menu') - click.echo(' q: quit') - char = click.getchar() - if char == 'd': - menu = 'debug' - elif char == 'q': - menu = 'quit' - else: - click.echo('Invalid input') - elif menu == 'debug': - click.echo('Debug menu') - click.echo(' b: back') - char = click.getchar() - if char == 'b': - menu = 'main' - else: - click.echo('Invalid input') - elif menu == 'quit': - return Binary files old/click-6.6/examples/termui/dist/click_example_termui-1.0-py3.4.egg and new/click-6.7/examples/termui/dist/click_example_termui-1.0-py3.4.egg differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/tests/test_bashcomplete.py new/click-6.7/tests/test_bashcomplete.py --- old/click-6.6/tests/test_bashcomplete.py 2016-04-04 18:27:24.000000000 +0200 +++ new/click-6.7/tests/test_bashcomplete.py 2016-12-01 13:33:48.000000000 +0100 @@ -3,7 +3,18 @@ import click from click._bashcomplete import get_choices -def test_basic(): + +def test_single_command(): + @click.command() + @click.option('--local-opt') + def cli(local_opt): + pass + + assert list(get_choices(cli, 'lol', [], '-')) == ['--local-opt'] + assert list(get_choices(cli, 'lol', [], '')) == [] + + +def test_small_chain(): @click.group() @click.option('--global-opt') def cli(global_opt): @@ -18,3 +29,34 @@ assert list(get_choices(cli, 'lol', [], '-')) == ['--global-opt'] assert list(get_choices(cli, 'lol', ['sub'], '')) == [] assert list(get_choices(cli, 'lol', ['sub'], '-')) == ['--local-opt'] + + +def test_long_chain(): + @click.group('cli') + @click.option('--cli-opt') + def cli(cli_opt): + pass + + @cli.group('asub') + @click.option('--asub-opt') + def asub(asub_opt): + pass + + @asub.group('bsub') + @click.option('--bsub-opt') + def bsub(bsub_opt): + pass + + @bsub.command('csub') + @click.option('--csub-opt') + def csub(csub_opt): + pass + + assert list(get_choices(cli, 'lol', [], '-')) == ['--cli-opt'] + assert list(get_choices(cli, 'lol', [], '')) == ['asub'] + assert list(get_choices(cli, 'lol', ['asub'], '-')) == ['--asub-opt'] + assert list(get_choices(cli, 'lol', ['asub'], '')) == ['bsub'] + assert list(get_choices(cli, 'lol', ['asub', 'bsub'], '-')) == ['--bsub-opt'] + assert list(get_choices(cli, 'lol', ['asub', 'bsub'], '')) == ['csub'] + assert list(get_choices(cli, 'lol', ['asub', 'bsub', 'csub'], '-')) == ['--csub-opt'] + assert list(get_choices(cli, 'lol', ['asub', 'bsub', 'csub'], '')) == [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/tests/test_imports.py new/click-6.7/tests/test_imports.py --- old/click-6.6/tests/test_imports.py 2015-11-29 17:31:33.000000000 +0100 +++ new/click-6.7/tests/test_imports.py 2016-12-01 13:33:48.000000000 +0100 @@ -32,7 +32,7 @@ ALLOWED_IMPORTS = set([ 'weakref', 'os', 'struct', 'collections', 'sys', 'contextlib', 'functools', 'stat', 're', 'codecs', 'inspect', 'itertools', 'io', - 'threading', 'colorama' + 'threading', 'colorama', 'errno' ]) if WIN: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/click-6.6/tests/test_testing.py new/click-6.7/tests/test_testing.py --- old/click-6.6/tests/test_testing.py 2015-11-29 17:31:33.000000000 +0100 +++ new/click-6.7/tests/test_testing.py 2017-01-06 23:32:37.000000000 +0100 @@ -1,3 +1,4 @@ +import os import sys import pytest @@ -183,3 +184,21 @@ result = runner.invoke(cli_no_error) assert result.exit_code == 0 assert result.output == 'hello world\n' + + +def test_env(): + @click.command() + def cli_env(): + click.echo('ENV=%s' % os.environ['TEST_CLICK_ENV']) + + runner = CliRunner() + + env_orig = dict(os.environ) + env = dict(env_orig) + assert 'TEST_CLICK_ENV' not in env + env['TEST_CLICK_ENV'] = 'some_value' + result = runner.invoke(cli_env, env=env) + assert result.exit_code == 0 + assert result.output == 'ENV=some_value\n' + + assert os.environ == env_orig
participants (1)
-
root@hilbertn.suse.de