diff --git a/zerver/tests/test_typed_endpoint.py b/zerver/tests/test_typed_endpoint.py index a0d9e719ed..2069f96d0c 100644 --- a/zerver/tests/test_typed_endpoint.py +++ b/zerver/tests/test_typed_endpoint.py @@ -42,10 +42,7 @@ class TestEndpoint(ZulipTestCase): """This test is only needed because we don't have coverage of is_optional in Python 3.11. """ - type = cast(Type[Optional[str]], Optional[str]) - self.assertTrue(is_optional(type)) - - type = str + self.assertTrue(is_optional(cast(Type[Optional[str]], Optional[str]))) self.assertFalse(is_optional(str)) def test_coerce(self) -> None: