From 2de3fb24262c13e66118d7320d9bb076c2096ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 4 Dec 2025 01:03:06 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Tweak=20coverage=20for=20u?= =?UTF-8?q?nreachable=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/dependencies/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fastapi/dependencies/models.py b/fastapi/dependencies/models.py index ac54a3cc8..1a65766ef 100644 --- a/fastapi/dependencies/models.py +++ b/fastapi/dependencies/models.py @@ -91,14 +91,14 @@ class Dependant: @cached_property def is_gen_callable(self) -> bool: if self.call is None: - return False + return False # pragma: no cover if inspect.isgeneratorfunction( _impartial(self.call) ) or inspect.isgeneratorfunction(_unwrapped_call(self.call)): return True dunder_call = getattr(_impartial(self.call), "__call__", None) # noqa: B004 if dunder_call is None: - return False + return False # pragma: no cover return inspect.isgeneratorfunction( _impartial(dunder_call) ) or inspect.isgeneratorfunction(_unwrapped_call(dunder_call)) @@ -106,14 +106,14 @@ class Dependant: @cached_property def is_async_gen_callable(self) -> bool: if self.call is None: - return False + return False # pragma: no cover if inspect.isasyncgenfunction( _impartial(self.call) ) or inspect.isasyncgenfunction(_unwrapped_call(self.call)): return True dunder_call = getattr(_impartial(self.call), "__call__", None) # noqa: B004 if dunder_call is None: - return False + return False # pragma: no cover return inspect.isasyncgenfunction( _impartial(dunder_call) ) or inspect.isasyncgenfunction(_unwrapped_call(dunder_call)) @@ -121,7 +121,7 @@ class Dependant: @cached_property def is_coroutine_callable(self) -> bool: if self.call is None: - return False + return False # pragma: no cover if inspect.isroutine(_impartial(self.call)) and iscoroutinefunction( _impartial(self.call) ): @@ -132,7 +132,7 @@ class Dependant: return True dunder_call = getattr(_impartial(self.call), "__call__", None) # noqa: B004 if dunder_call is None: - return False + return False # pragma: no cover if iscoroutinefunction(_impartial(dunder_call)) or iscoroutinefunction( _unwrapped_call(dunder_call) ):