diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 1e812e1d525a81..8681e7efba3244 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -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() diff --git a/Lib/typing.py b/Lib/typing.py index 3493257677c7ff..5e3e1f298295c7 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -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. """