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

Method get_module_names

Lib/test/_test_multiprocessing.py:5186–5195  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5184class _TestImportStar(unittest.TestCase):
5185
5186 def get_module_names(self):
5187 import glob
5188 folder = os.path.dirname(multiprocessing.__file__)
5189 pattern = os.path.join(glob.escape(folder), '*.py')
5190 files = glob.glob(pattern)
5191 modules = [os.path.splitext(os.path.split(f)[1])[0] for f in files]
5192 modules = ['multiprocessing.' + m for m in modules]
5193 modules.remove('multiprocessing.__init__')
5194 modules.append('multiprocessing')
5195 return modules
5196
5197 def test_import(self):
5198 modules = self.get_module_names()

Callers 1

test_importMethod · 0.95

Calls 8

escapeMethod · 0.80
splitextMethod · 0.80
dirnameMethod · 0.45
joinMethod · 0.45
globMethod · 0.45
splitMethod · 0.45
removeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected