From e3d57c9586274d8e619ce7e172c7edc8593db196 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 4 Dec 2022 01:45:50 -0800 Subject: [PATCH] ruff: Fix B006 Do not use mutable data structures for argument defaults. Signed-off-by: Anders Kaseorg --- pyproject.toml | 1 - zerver/lib/test_classes.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8c88a90de4..14be9d2741 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,7 +116,6 @@ ignore = [ "ANN101", # Missing type annotation for `self` in method "ANN102", # Missing type annotation for `cls` in classmethod "ANN401", # Dynamically typed expressions (typing.Any) are disallowed - "B006", # Do not use mutable data structures for argument defaults "B007", # Loop control variable not used within the loop body "B008", # Do not perform function calls in argument defaults. "B023", # Function definition does not bind loop variable diff --git a/zerver/lib/test_classes.py b/zerver/lib/test_classes.py index d85fc4f4ca..d708edf5d5 100644 --- a/zerver/lib/test_classes.py +++ b/zerver/lib/test_classes.py @@ -462,7 +462,7 @@ Output: def client_post( self, url: str, - info: Union[str, bytes, Dict[str, Any]] = {}, + info: Union[str, bytes, Mapping[str, Any]] = {}, skip_user_agent: bool = False, follow: bool = False, secure: bool = False, @@ -875,7 +875,7 @@ Output: self, identifier: str, url: str, - info: Union[str, bytes, Dict[str, Any]] = {}, + info: Union[str, bytes, Mapping[str, Any]] = {}, **extra: str, ) -> "TestHttpResponse": extra["HTTP_AUTHORIZATION"] = self.encode_uuid(identifier) @@ -907,7 +907,7 @@ Output: self, user: UserProfile, url: str, - info: Union[str, bytes, Dict[str, Any]] = {}, + info: Union[str, bytes, Mapping[str, Any]] = {}, intentionally_undocumented: bool = False, **extra: str, ) -> "TestHttpResponse":