mirror of
https://github.com/python/cpython.git
synced 2025-08-08 19:09:46 +00:00
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
f383ca1a6f
commit
83c7dd5200
3 changed files with 16 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue