Skip to content
Myr

Merge branch '5.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 bb94c38, c293365 · Browse files · 3 files+23 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+23 added−1 removed

  • tests:+16 added−0 removed
  • other:+7 added−1 removed

3 files+23 added−1 removed

modified:click/decorators.py-1 removed
20 unmodified lines
21 """Similar to :func:`pass_context`, but only pass the object on the22 context onwards (:attr:`Context.obj`). This is useful if that object23 represents the state of a nested system.24 """25 @pass_context25 def new_func(*args, **kwargs):26 return f(get_current_context().obj, *args, **kwargs)27 return update_wrapper(new_func, f)28
275 unmodified lines
modified:tests/test_context.py+16 added
166 unmodified lines
167 # Internal168 assert ctx._depth == 1169170 assert rv == [42]171172173def test_pass_obj(runner):174 @click.group()175 @click.pass_context176 def cli(ctx):177 ctx.obj = 'test'178179 @cli.command()180 @click.pass_obj181 def test(obj):182 click.echo(obj)183184 result = runner.invoke(cli, ['test'])185 assert not result.exception186 assert result.output == 'test\n'
modified:CHANGES+7 added
1 unmodified line
2===============34This contains all major version changes between Click releases.56Version 5.17-----------89(bugfix release, release date to be determined)1011- Fix a bug in `pass_obj` that would accidentally pass the context too.1213Version 5.014-----------1516(codename "tok tok", released on 16th August 2015)
243 unmodified lines