MCPcopy Index your code
hub / github.com/python/cpython / test_all_exported_names

Method test_all_exported_names

Lib/test/test_typing.py:11076–11096  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

11074 self.assertIn('SupportsComplex', a)
11075
11076 def test_all_exported_names(self):
11077 # ensure all dynamically created objects are actualised
11078 for name in typing.__all__:
11079 getattr(typing, name)
11080
11081 actual_all = set(typing.__all__)
11082 computed_all = {
11083 k for k, v in vars(typing).items()
11084 # explicitly exported, not a thing with __module__
11085 if k in actual_all or (
11086 # avoid private names
11087 not k.startswith('_') and
11088 # there's a few types and metaclasses that aren't exported
11089 not k.endswith(('Meta', '_contra', '_co')) and
11090 not k.upper() == k and
11091 k not in {"ByteString"} and
11092 # but export all other things that have __module__ == 'typing'
11093 getattr(v, '__module__', None) == typing.__name__
11094 )
11095 }
11096 self.assertSetEqual(computed_all, actual_all)
11097
11098
11099class TypeIterationTests(BaseTestCase):

Callers

nothing calls this directly

Calls 6

setFunction · 0.85
assertSetEqualMethod · 0.80
itemsMethod · 0.45
startswithMethod · 0.45
endswithMethod · 0.45
upperMethod · 0.45

Tested by

no test coverage detected