The decorator login_required is passed the function (hello in this case).
So what you want to do is:
def login_required(f):
# This function is what we "replace" hello with
def wrapper(*args, **kw):
args[0].client_session['test'] = True
logged_in = 0
if logged_in:
return f(*args, **kw) # Call hello
else:
return redirect(url_for('login'))
return wrapper