human
Complete the below
def gen_with_app(*args, **kwargs):

    ''''Decorate a test generator to pass a TestApp as the first argument to the
    test generator when it\'s executed.'
    '''
assistant
#Here is the Python code you requested.
    def generator(func):
        @wraps(func)
        def deco(*args2, **kwargs2):
            app = TestApp(*args, **kwargs)
            for item in func(app, *args2, **kwargs2):
                (yield item)
            app.cleanup()
        return deco
    return generator