From e3a8f992d5fcbae76a94fdff01b41f62f62483ee Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 22 Dec 2021 21:59:47 -0800 Subject: [PATCH] test_openapi: Fix __wrapped__ accesses. Signed-off-by: Anders Kaseorg --- zerver/tests/test_openapi.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/zerver/tests/test_openapi.py b/zerver/tests/test_openapi.py index f0312e7466..74fdf807f2 100644 --- a/zerver/tests/test_openapi.py +++ b/zerver/tests/test_openapi.py @@ -434,10 +434,8 @@ do not match the types declared in the implementation of {function.__name__}.\n" # Iterate through the decorators to find the original # function, wrapped by has_request_variables, so we can parse # its arguments. - while getattr(function, "__wrapped__", None): - function = getattr(function, "__wrapped__", None) - # Tell mypy this is never None. - assert function is not None + while hasattr(function, "__wrapped__"): + function = getattr(function, "__wrapped__") # Now, we do inference mapping each REQ parameter's # declaration details to the Python/mypy types for the