mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-112155: Run typing.py doctests as part of test_typing (#112156)
This commit is contained in:
parent
12c7e9d573
commit
7680da4583
2 changed files with 8 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue