From: Ben Darnell Date: Fri, 28 Jun 2024 20:39:30 +0000 (-0400) Subject: util_test: Slightly clean up old-style type annotations X-Git-Tag: v6.5.0b1~45^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3410%2Fhead;p=thirdparty%2Ftornado.git util_test: Slightly clean up old-style type annotations --- diff --git a/tornado/test/util_test.py b/tornado/test/util_test.py index 4ce9ab68..baa2ff2b 100644 --- a/tornado/test/util_test.py +++ b/tornado/test/util_test.py @@ -16,11 +16,7 @@ from tornado.util import ( re_unescape, ) -import typing -from typing import cast - -if typing.TYPE_CHECKING: - from typing import Dict, Any # noqa: F401 +from typing import cast, Dict, Any class RaiseExcInfoTest(unittest.TestCase): @@ -257,7 +253,7 @@ class ArgReplacerTest(unittest.TestCase): def test_omitted(self): args = (1, 2) - kwargs = dict() # type: Dict[str, Any] + kwargs: Dict[str, Any] = dict() self.assertIsNone(self.replacer.get_old_value(args, kwargs)) self.assertEqual( self.replacer.replace("new", args, kwargs), @@ -266,7 +262,7 @@ class ArgReplacerTest(unittest.TestCase): def test_position(self): args = (1, 2, "old", 3) - kwargs = dict() # type: Dict[str, Any] + kwargs: Dict[str, Any] = dict() self.assertEqual(self.replacer.get_old_value(args, kwargs), "old") self.assertEqual( self.replacer.replace("new", args, kwargs),