From: Thomas Kluyver Date: Fri, 10 Feb 2023 17:12:14 +0000 (+0000) Subject: Re-suppress asyncio deprecation warnings in AsyncTestCase X-Git-Tag: v6.3.0b1~8^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6772f907f9bb09d9556205791053bcf4ca06dc48;p=thirdparty%2Ftornado.git Re-suppress asyncio deprecation warnings in AsyncTestCase --- diff --git a/tornado/testing.py b/tornado/testing.py index 508b1273f..cadb28bec 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -182,6 +182,13 @@ class AsyncTestCase(unittest.TestCase): self._test_generator = None # type: Optional[Union[Generator, Coroutine]] def setUp(self) -> None: + setup_with_context_manager(self, warnings.catch_warnings()) + warnings.filterwarnings( + "ignore", + message="There is no current event loop", + category=DeprecationWarning, + module=r"tornado\..*", + ) super().setUp() self.io_loop = self.get_new_ioloop() self.io_loop.make_current()