Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ruff: Fix B011 Do not `assert False` (`python -O` removes these calls).

Anders Kaseorge1a2894af9bb
diff --git a/tools/tail-ses b/tools/tail-ses
index 8de0366b4fa..a82ae424863 100755
--- a/tools/tail-ses
+++ b/tools/tail-ses
@@ -81,7 +81,7 @@ def get_ses_arn(session: boto3.session.Session, args: argparse.Namespace) -> str
return settings["ComplaintTopic"]
elif args.deliveries:
return settings["DeliveryTopic"]
- assert False # Unreachable
+ raise AssertionError() # Unreachable
@contextmanager
diff --git a/zerver/tests/test_compatibility.py b/zerver/tests/test_compatibility.py
index cd529143fba..856c815cd42 100644
--- a/zerver/tests/test_compatibility.py
+++ b/zerver/tests/test_compatibility.py
@@ -51,7 +51,7 @@ class VersionTest(ZulipTestCase):
self.assertIsNone(version_lt(ver1, ver2), msg=msg)
self.assertIsNone(version_lt(ver2, ver1), msg=msg)
else:
- assert False # nocoverage
+ raise AssertionError() # nocoverage
mobile_os_data = [
case.split(None, 1)
@@ -110,7 +110,7 @@ class CompatibilityTest(ZulipTestCase):
elif expected == "old":
self.assert_json_error(result, "Client is too old")
else:
- assert False # nocoverage
+ raise AssertionError() # nocoverage
@mock.patch("zerver.lib.compatibility.DESKTOP_MINIMUM_VERSION", "5.0.0")
@mock.patch("zerver.lib.compatibility.DESKTOP_WARNING_VERSION", "5.2.0")