]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Reset DeprecationWarning filters in test_typing io and re (#26811)
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Mon, 21 Jun 2021 18:17:55 +0000 (02:17 +0800)
committerGitHub <noreply@github.com>
Mon, 21 Jun 2021 18:17:55 +0000 (11:17 -0700)
Lib/test/test_typing.py
Misc/NEWS.d/next/Library/2021-06-14-14-19-11.bpo-38291.ee4cSX.rst

index 06df3e23264cb2455aefee1ef08d8ae6ea21fcc1..eff0f5bfc4b1e16af3b7974452b3e5cd35992b48 100644 (file)
@@ -3998,6 +3998,7 @@ class IOTests(BaseTestCase):
 
     def test_io_submodule(self):
         with warnings.catch_warnings(record=True) as w:
+            warnings.filterwarnings("default", category=DeprecationWarning)
             from typing.io import IO, TextIO, BinaryIO, __all__, __name__
             self.assertIs(IO, typing.IO)
             self.assertIs(TextIO, typing.TextIO)
@@ -4052,6 +4053,7 @@ class RETests(BaseTestCase):
 
     def test_re_submodule(self):
         with warnings.catch_warnings(record=True) as w:
+            warnings.filterwarnings("default", category=DeprecationWarning)
             from typing.re import Match, Pattern, __all__, __name__
             self.assertIs(Match, typing.Match)
             self.assertIs(Pattern, typing.Pattern)
index 7fb891dd4bc0c92748e44a369b32d7364dfbdbfc..078d78d1778b1fa134a8a1690ee51fe3d1485cec 100644 (file)
@@ -1 +1 @@
-Importing typing.io or typing.re now prints a `DeprecationWarning`.
+Importing typing.io or typing.re now prints a ``DeprecationWarning``.