Fix check_real location guard (#31890)

This commit is contained in:
Martin Hjelmare 2020-02-17 00:33:09 +01:00 committed by GitHub
parent 4dc4f84b37
commit e3adbc336d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,7 +39,7 @@ def check_real(func):
"""Force a function to require a keyword _test_real to be passed in."""
@functools.wraps(func)
def guard_func(*args, **kwargs):
async def guard_func(*args, **kwargs):
real = kwargs.pop("_test_real", None)
if not real:
@ -47,7 +47,7 @@ def check_real(func):
'Forgot to mock or pass "_test_real=True" to %s', func.__name__
)
return func(*args, **kwargs)
return await func(*args, **kwargs)
return guard_func