Skip to content

Commit

Permalink
pythongh-112155: Run typing.py doctests as part of test_typing (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Nov 16, 2023
1 parent 12c7e9d commit 7680da4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9464,5 +9464,11 @@ def test_is_not_instance_of_iterable(self):
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()
4 changes: 2 additions & 2 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down

0 comments on commit 7680da4

Please sign in to comment.