human
I wrote the below code

    @click.group(cls=AppGroup)
    def cli():
        pass
    @cli.command(with_appcontext=True)
    def test():
        click.echo(current_app.name)
    @cli.group()
    def subgroup():
        pass
    @subgroup.command(with_appcontext=True)
    def test2():
        click.echo(current_app.name)
    obj = ScriptInfo(create_app=(lambda info: Flask('testappgroup')))
    result = runner.invoke(cli, ['test'], obj=obj)
    assert (result.exit_code == 0)
    assert (result.output == 'testappgroup\n')
    result = runner.invoke(cli, ['subgroup', 'test2'], obj=obj)
    assert (result.exit_code == 0)
    assert (result.output == 'testappgroup\n')

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def test_appgroup(runner):