From 5000c9fc9c5967b0717f6c398b0d06ab8d3ba5d9 Mon Sep 17 00:00:00 2001 From: Renan Heckert Leal <123672970+lealre@users.noreply.github.com> Date: Fri, 13 Dec 2024 22:43:43 +0000 Subject: [PATCH] tests: Add skipped coverages for `websockets.py` and `templating.py` using `branch=true` (#2793) Co-authored-by: Marcelo Trylesinski --- starlette/templating.py | 2 +- starlette/websockets.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/starlette/templating.py b/starlette/templating.py index 17e7fa4d..78bfb8c2 100644 --- a/starlette/templating.py +++ b/starlette/templating.py @@ -98,7 +98,7 @@ class Jinja2Templates: self.context_processors = context_processors or [] if directory is not None: self.env = self._create_env(directory, **env_options) - elif env is not None: + elif env is not None: # pragma: no branch self.env = env self._setup_env_defaults(self.env) diff --git a/starlette/websockets.py b/starlette/websockets.py index b7acaa3f..6b46f4ea 100644 --- a/starlette/websockets.py +++ b/starlette/websockets.py @@ -103,7 +103,7 @@ class WebSocket(HTTPConnection): ) -> None: headers = headers or [] - if self.client_state == WebSocketState.CONNECTING: + if self.client_state == WebSocketState.CONNECTING: # pragma: no branch # If we haven't yet seen the 'connect' message, then wait for it first. await self.receive() await self.send({"type": "websocket.accept", "subprotocol": subprotocol, "headers": headers})