mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.11] gh-115570: Fix DeprecationWarnings in test_typing (#115571)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
963315cbd9
commit
c01a4808d3
3 changed files with 15 additions and 1 deletions
|
@ -7319,6 +7319,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.assertRaises(TypeError) as ex:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue