mirror of https://github.com/python/cpython
gh-112155: Run `typing.py` doctests as part of `test_typing` (#112156)
This commit is contained in:
parent
12c7e9d573
commit
7680da4583
|
@ -9464,5 +9464,11 @@ class TypeIterationTests(BaseTestCase):
|
|||
self.assertNotIsInstance(type_to_test, collections.abc.Iterable)
|
||||
|
||||
|
||||
def load_tests(loader, tests, pattern):
|
||||
import doctest
|
||||
tests.addTests(doctest.DocTestSuite(typing))
|
||||
return tests
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -3404,8 +3404,8 @@ def get_protocol_members(tp: type, /) -> frozenset[str]:
|
|||
>>> class P(Protocol):
|
||||
... def a(self) -> str: ...
|
||||
... b: int
|
||||
>>> get_protocol_members(P)
|
||||
frozenset({'a', 'b'})
|
||||
>>> get_protocol_members(P) == frozenset({'a', 'b'})
|
||||
True
|
||||
|
||||
Raise a TypeError for arguments that are not Protocols.
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue