Merge pull request #17365 from mvdbeek/warn_unreachable

Enable ``warn_unreachable`` mypy option
This commit is contained in:
Marius van den Beek
2024-02-12 11:04:45 +01:00
committed by GitHub
35 changed files with 119 additions and 93 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ from datetime import (
datetime,
timedelta,
)
from typing import Optional
from unittest import SkipTest
from urllib.parse import (
parse_qs,
@@ -189,7 +190,7 @@ class TestCustosAuthnz(TestCase):
class Query:
external_user_id = None
provider = None
custos_authnz_token = None
custos_authnz_token: Optional[CustosAuthnzToken] = None
def filter_by(self, email=None, external_user_id=None, provider=None, username=None):
self.external_user_id = external_user_id
@@ -267,7 +267,7 @@ class TestHistoryManager(BaseTestCase):
assert len(self.history_manager.get_share_assocs(item1, user=non_owner)) == 1
assert isinstance(item1.slug, str)
self.log("should be able to unshare with specific users")
self.log("should be able to unshare with specific users") # type: ignore[unreachable]
share_assoc = self.history_manager.unshare_with(item1, non_owner)
assert isinstance(share_assoc, model.HistoryUserShareAssociation)
assert not self.history_manager.is_accessible(item1, non_owner)
@@ -107,7 +107,7 @@ class TestToolPanelManager(BaseToolBoxTestCase):
# New GUID replaced old one in tool panel but both
# appear in integrated tool panel.
if previous_guid:
assert (f"tool_{previous_guid}") not in section.panel_items()
assert (f"tool_{previous_guid}") not in section.panel_items() # type: ignore[unreachable]
assert (f"tool_{guid}") in self.toolbox._integrated_tool_panel["tid1"].panel_items()
previous_guid = guid