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})