summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_typing.py
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2024-02-16 21:46:48 (GMT)
committerGitHub <noreply@github.com>2024-02-16 21:46:48 (GMT)
commit83c7dd5200bae16d2f2f942fb0a826723d3023cc (patch)
tree9f61aa1b722bd4d42767432f8c523a3314ade947 /Lib/test/test_typing.py
parentf383ca1a6fa1a2a83c8c1a0e56cf997c77fa2893 (diff)
downloadcpython-83c7dd5200bae16d2f2f942fb0a826723d3023cc.zip
cpython-83c7dd5200bae16d2f2f942fb0a826723d3023cc.tar.gz
cpython-83c7dd5200bae16d2f2f942fb0a826723d3023cc.tar.bz2
[3.12] gh-115570: Fix DeprecationWarnings in test_typing (#115571) (#115574)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r--Lib/test/test_typing.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index ab9d8a0..7f9c10d 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -8123,6 +8123,17 @@ class RETests(BaseTestCase):
self.assertEqual(__name__, 'typing.re')
self.assertEqual(len(w), 1)
+ def test_re_submodule_access_basics(self):
+ with warnings.catch_warnings():
+ warnings.filterwarnings("error", category=DeprecationWarning)
+ from typing import re
+ self.assertIsInstance(re.__doc__, str)
+ self.assertEqual(re.__name__, "typing.re")
+ self.assertIsInstance(re.__dict__, types.MappingProxyType)
+
+ with self.assertWarns(DeprecationWarning):
+ re.Match
+
def test_cannot_subclass(self):
with self.assertRaisesRegex(
TypeError,