10000 gh-112155: Run `typing.py` doctests as part of `test_typing` (#112156) · python/cpython@7680da4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7680da4

Browse files
authored
gh-112155: Run typing.py doctests as part of test_typing (#112156)
1 parent 12c7e9d commit 7680da4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Lib/test/test_typing.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9464,5 +9464,11 @@ def test_is_not_instance_of_iterable(self):
94649464
self.assertNotIsInstance(type_to_test, collections.abc.Iterable)
94659465

94669466

9467+
def load_tests(loader, tests, pattern):
9468+
import doctest
9469+
tests.addTests(doctest.DocTestSuite(typing))
9470+
return tests
9471+
9472+
94679473
if __name__ == '__main__':
94689474
main()

Lib/typing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3404,8 +3404,8 @@ def get_protocol_members(tp: type, /) -> frozenset[str]:
34043404
>>> class P(Protocol):
34053405
... def a(self) -> str: ...
34063406
... b: int
3407-
>>> get_protocol_members(P)
3408-
frozenset({'a', 'b'})
3407+
>>> get_protocol_members(P) == frozenset({'a', 'b'})
3408+
True
34093409
34103410
Raise a TypeError for arguments that are not Protocols.
34113411
"""

0 commit comments

Comments
 (0)
0