def test_with_appcontext():
 @click.command()
 @with_appcontext
 def testcmd():
  click.echo(current_app.name)
 obj = ScriptInfo(create_app=(lambda info: Flask('testapp')))
 runner = CliRunner()
 result = runner.invoke(testcmd, obj=obj)
 assert (result.exit_code == 0)
 assert (result.output == 'testapp\n')

def test_with_appcontext ( ) : @ click . command ( ) @ with_appcontext def testcmd ( ) : click . echo ( current_app . name ) obj = ScriptInfo ( create_app = ( lambda info : Flask ( 'testapp' ) ) ) runner = CliRunner ( ) result = runner . invoke ( testcmd , obj = obj ) assert ( result . exit_code == 0 ) assert ( result . output == 'testapp\n' )
test of with_appcontext .