'Like :meth:`Flask.teardown_request` but for a blueprint.  This
function is only executed when tearing down requests handled by a
function of that blueprint.  Teardown request functions are executed
when the request context is popped, even when no actual request was
performed.'

def teardown_request(self, f):

    self.record_once((lambda s: s.app.teardown_request_funcs.setdefault(self.name, []).append(f)))
    return f
