Skip to content
Myr

Added a test for multi command entering.

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

authored by Armin Ronacher · committed by Armin Ronacher · parent 5a90908 · Browse files · 1 file+19 added−0 removed
This commit

State

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

Diff stats

1 file+19 added−0 removed

  • tests:+19 added−0 removed

1 file+19 added−0 removed

modified:tests/test_context.py+19 added
89 unmodified lines
90 assert result.exception is not None91 assert isinstance(result.exception, RuntimeError)92 assert "Managed to invoke callback without a context object " \93 "of type 'Foo' existing" in str(result.exception)949596def test_multi_enter(runner):97 called = []9899 @click.command()100 @click.pass_context101 def cli(ctx):102 def callback():103 called.append(True)104 ctx.call_on_close(callback)105106 with ctx:107 pass108 assert not called109110 result = runner.invoke(cli, [])111 assert result.exception is None112 assert called == [True]