MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_all_exported_names

Method test_all_exported_names

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

Source from the content-addressed store, hash-verified

10878 self.assertIn('SupportsComplex', a)
10879
10880 def test_all_exported_names(self):
10881 # ensure all dynamically created objects are actualised
10882 for name in typing.__all__:
10883 getattr(typing, name)
10884
10885 actual_all = set(typing.__all__)
10886 computed_all = {
10887 k for k, v in vars(typing).items()
10888 # explicitly exported, not a thing with __module__
10889 if k in actual_all or (
10890 # avoid private names
10891 not k.startswith('_') and
10892 # there's a few types and metaclasses that aren't exported
10893 not k.endswith(('Meta', '_contra', '_co')) and
10894 not k.upper() == k and
10895 # but export all things that have __module__ == 'typing'
10896 getattr(v, '__module__', None) == typing.__name__
10897 )
10898 }
10899 self.assertSetEqual(computed_all, actual_all)
10900
10901
10902class TypeIterationTests(BaseTestCase):

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected