From 7aef575a41c432f5a62061594c8b88f1a6c86006 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Wed, 29 Dec 2021 12:30:59 +0000 Subject: [PATCH 1/3] Fix type annotation in test_account_data --- mypy.ini | 1 - tests/storage/test_account_data.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mypy.ini b/mypy.ini index 724c7e2ae47e..e0204a3c0408 100644 --- a/mypy.ini +++ b/mypy.ini @@ -100,7 +100,6 @@ exclude = (?x) |tests/server.py |tests/server_notices/test_resource_limits_server_notices.py |tests/state/test_v2.py - |tests/storage/test_account_data.py |tests/storage/test_background_update.py |tests/storage/test_base.py |tests/storage/test_client_ips.py diff --git a/tests/storage/test_account_data.py b/tests/storage/test_account_data.py index 01af49a16b0f..d697d2bc1e79 100644 --- a/tests/storage/test_account_data.py +++ b/tests/storage/test_account_data.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Iterable, Set +from typing import Iterable, Optional, Set from synapse.api.constants import AccountDataTypes @@ -25,7 +25,7 @@ def prepare(self, hs, reactor, clock): self.user = "@user:test" def _update_ignore_list( - self, *ignored_user_ids: Iterable[str], ignorer_user_id: str = None + self, *ignored_user_ids: Iterable[str], ignorer_user_id: Optional[str] = None ) -> None: """Update the account data to block the given users.""" if ignorer_user_id is None: From 3995d1d90b86c250786b850a7ecb358467d1798c Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Wed, 29 Dec 2021 13:27:19 +0000 Subject: [PATCH 2/3] Newsfile Signed-off-by: Olivier Wilkinson (reivilibre) --- changelog.d/11657.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/11657.misc diff --git a/changelog.d/11657.misc b/changelog.d/11657.misc new file mode 100644 index 000000000000..f32423f4c0b9 --- /dev/null +++ b/changelog.d/11657.misc @@ -0,0 +1 @@ +Fix a type annotation in `test_account_data.py` and remove it from the Mypy exclusion list. \ No newline at end of file From fc3243d34c1b16e967faf1256dfd626d85add100 Mon Sep 17 00:00:00 2001 From: reivilibre Date: Wed, 29 Dec 2021 14:45:06 +0000 Subject: [PATCH 3/3] Update changelog.d/11657.misc Co-authored-by: Patrick Cloke --- changelog.d/11657.misc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/11657.misc b/changelog.d/11657.misc index f32423f4c0b9..8e405b922674 100644 --- a/changelog.d/11657.misc +++ b/changelog.d/11657.misc @@ -1 +1 @@ -Fix a type annotation in `test_account_data.py` and remove it from the Mypy exclusion list. \ No newline at end of file +Add missing type hints to storage classes. \ No newline at end of file