Mailing List Archive

1 2  View All
[issue40275] test.support has way too many imports [ In reply to ]
Change by hai shi <shihai1991@126.com>:


----------
pull_requests: +20944
pull_request: https://github.com/python/cpython/pull/21811

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue40275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue40275] test.support has way too many imports [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 490c5426b1b23831d83d0c6b269858fb98450889 by Hai Shi in branch 'master':
bpo-40275: Fix failed test cases by using test helpers (GH-21811)
https://github.com/python/cpython/commit/490c5426b1b23831d83d0c6b269858fb98450889


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue40275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue40275] test.support has way too many imports [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

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']

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue40275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue40275] test.support has way too many imports [ In reply to ]
hai shi <shihai1991@126.com> added the comment:

Hi, victor:
About https://bugs.python.org/issue40275#msg369214, shall we continue to improve the libregretest?
1. Running test cases sequential: you have use a mechanism to unload the modules which load in the running test cases stage: https://github.com/python/cpython/blob/master/Lib/test/libregrtest/main.py#L437
2. Running test cases concurrently: It have use subprocess to isolate the module resources, no?
I am not sure about it.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue40275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue40275] test.support has way too many imports [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

> About https://bugs.python.org/issue40275#msg369214, shall we continue to improve the libregretest?

If someone wants to continue the effort in libregrtest, I suggest to open a new issue. This one already has a long list of commits and messages about test.support.

See test.libregrtest.runtest_mp module for the "multiprocessing" implementation which uses subprocess. It's used when you run tests using -jN option. Almost all buildbots use -jN: see make buildbottest.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue40275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue40275] test.support has way too many imports [ In reply to ]
hai shi <shihai1991@126.com> added the comment:

If someone wants to continue the effort in libregrtest, I suggest to open a new issue.
+1. And if there have any other test cases blocked by test.support, I suggest this bpo.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue40275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue40275] test.support has way too many imports [ In reply to ]
hai shi <shihai1991@126.com> added the comment:

oh, sorry, missing a word: I suggest this bpo.->I suggest close this bpo.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue40275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

1 2  View All