From e1a2894af9bb945586268e67367af8d02728a09a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 29 Oct 2022 18:12:04 -0400 Subject: [PATCH] ruff: Fix B011 Do not `assert False` (`python -O` removes these calls). Signed-off-by: Anders Kaseorg --- tools/tail-ses | 2 +- zerver/tests/test_compatibility.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/tail-ses b/tools/tail-ses index 8de0366b4f..a82ae42486 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 cd529143fb..856c815cd4 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")