Author vstinner
Recipients miss-islington, pablogsal, shihai1991, terry.reedy, vstinner
Date 2020-08-10.21:32:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1597095132.06.0.719418028865.issue40275@roundup.psfhosted.org>
In-reply-to
Content
Update.

"import test.support" now imports 37 modules, instead of 171 previously. It's way better!

23:26:20 vstinner@apu$ ./python
Python 3.10.0a0 (heads/master:598a951844, Aug  7 2020, 17:24:10) 
[GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import test
>>> before=set(sys.modules)
>>> import test.support
>>> after=set(sys.modules)
>>> len(after - before)
37
>>> import pprint; pprint.pprint(sorted(after - before))
['_datetime',
 '_elementtree',
 '_heapq',
 '_sysconfigdata_d_linux_x86_64-linux-gnu',
 '_testcapi',
 '_weakrefset',
 'argparse',
 'copy',
 'datetime',
 'difflib',
 'fnmatch',
 'gettext',
 'heapq',
 'math',
 'pprint',
 'pyexpat',
 'pyexpat.errors',
 'pyexpat.model',
 'signal',
 'sysconfig',
 'test.support',
 'test.support.testresult',
 'traceback',
 'unittest',
 'unittest.case',
 'unittest.loader',
 'unittest.main',
 'unittest.result',
 'unittest.runner',
 'unittest.signals',
 'unittest.suite',
 'unittest.util',
 'weakref',
 'xml',
 'xml.etree',
 'xml.etree.ElementPath',
 'xml.etree.ElementTree']


Shorter list if imports made by unittest are ignored:

23:27:42 vstinner@apu$ ./python
Python 3.10.0a0 (heads/master:598a951844, Aug  7 2020, 17:24:10) 
[GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, unittest, test
>>> before=set(sys.modules)
>>> before=set(sys.modules); import test.support; after=set(sys.modules)
>>> len(after) - len(before)
17
>>> import pprint; pprint.pprint(sorted(after - before))
['_datetime',
 '_elementtree',
 '_sysconfigdata_d_linux_x86_64-linux-gnu',
 '_testcapi',
 'copy',
 'datetime',
 'math',
 'pyexpat',
 'pyexpat.errors',
 'pyexpat.model',
 'sysconfig',
 'test.support',
 'test.support.testresult',
 'xml',
 'xml.etree',
 'xml.etree.ElementPath',
 'xml.etree.ElementTree']
History
Date User Action Args
2020-08-10 21:32:12vstinnersetrecipients: + vstinner, terry.reedy, pablogsal, miss-islington, shihai1991
2020-08-10 21:32:12vstinnersetmessageid: <1597095132.06.0.719418028865.issue40275@roundup.psfhosted.org>
2020-08-10 21:32:12vstinnerlinkissue40275 messages
2020-08-10 21:32:11vstinnercreate