Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue11995

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:test_pydoc loads all Python modules
Type:Stage:resolved
Components:TestsVersions:Python 3.3, Python 3.4, Python 2.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Arfrever, eric.araujo, eric.snow, pitrou, python-dev, vstinner
Priority:normalKeywords:patch

Created on2011-05-04 08:29 byvstinner, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
test_pydoc_imports.patchpitrou,2013-05-18 20:35review
Messages (9)
msg135100 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2011-05-04 08:29
PydocUrlHandlerTest.test_url_requests() of test_doc checks "search?key=pydoc" URL. This operation has to load all Python modules to get their documentation. The problem is that loading all modules can have border effects with other tests. The most recent example: test_signal fails if it runs after test_pydoc. test_pydoc imports _tkinter and _tkinter loads the Tcl library which creates a thread waiting events in select(). The problem is that test_signal supposes that there is only one running thread.Can we run tests loading all modules in a subprocess?I have a fix to test_signal, so this bug is not really blocker, but it's better if a test doesn't touch the environment too much.---To see which modules are imported by pydoc, you can use:import pydoc; pydoc.ModuleScanner().run(lambda *args: 0, 'XXX')Result on my host (using python -v):__future___ast_bz2_compat_pickle_ctypes_curses_datetime_hashlib_json_multiprocessing_pickle_posixsubprocess_random_socket_sqlite3_struct_symtable_tkinterarrayatexitbdbbinasciibz2cmdcodecodeopconcurrentconcurrentconcurrent.futuresconcurrent.futuresconcurrent.futures._baseconcurrent.futures.processconcurrent.futures.threadcontextlibcopyctypesctypesctypes._endianctypes.macholibctypes.macholibctypes.testctypes.testcursescursescurses.wrapperdatetimedbmdbmdifflibdistutilsdistutilsdistutils.commanddistutils.commanddistutils.testsdistutils.testsdoctestemailemailemail.mimeemail.mimeencodings.cp1252encodings.idnaencodings.koi8_rfaulthandlerfcntlfnmatchgcgetoptgettextgrphashlibhtmlhtmlhttphttpidlelibidlelibimportlibimportlibimportlib._bootstrapimportlib.testimportlib.testimportlib.test.builtinimportlib.test.builtinimportlib.test.extensionimportlib.test.extensionimportlib.test.frozenimportlib.test.frozenimportlib.test.import_importlib.test.import_importlib.test.sourceimportlib.test.sourcejsonjsonjson.decoderjson.encoderjson.scannerlib2to3lib2to3lib2to3.btm_matcherlib2to3.btm_utilslib2to3.fixer_baselib2to3.fixer_utillib2to3.fixeslib2to3.fixeslib2to3.fixes.fix_importslib2to3.fixes.fix_imports2lib2to3.fixes.fix_urlliblib2to3.mainlib2to3.patcomplib2to3.pgen2lib2to3.pgen2lib2to3.pgen2.driverlib2to3.pgen2.grammarlib2to3.pgen2.literalslib2to3.pgen2.parselib2to3.pgen2.pgenlib2to3.pgen2.tokenlib2to3.pgen2.tokenizelib2to3.pygramlib2to3.pytreelib2to3.refactorlib2to3.testslib2to3.testslib2to3.tests.supportlib2to3.tests.test_all_fixerslib2to3.tests.test_fixerslib2to3.tests.test_mainlib2to3.tests.test_parserlib2to3.tests.test_pytreelib2to3.tests.test_refactorlib2to3.tests.test_utillogginglogginglogging.handlersmarshalmathmsilibmsilibmultiprocessingmultiprocessingmultiprocessing.dummymultiprocessing.dummymultiprocessing.dummy.connectionmultiprocessing.forkingmultiprocessing.processmultiprocessing.queuesmultiprocessing.synchronizemultiprocessing.utilmyfixesmyfixesoptparsepdbpicklepprintpwdpydoc_datapydoc_dataqueuerandomselectshutilsocketsqlite3sqlite3sqlite3.dbapi2sqlite3.testsqlite3.teststringprepstructsubprocesstarfiletempfiletesttesttest.encoded_modulestest.encoded_modulestest.json_teststest.json_teststest.leakerstest.leakerstest.supporttest.test_emailtest.test_emailtest.tracedmodulestest.tracedmodulestextwrapthreadingtkintertkintertkinter.constantstkinter.testtkinter.testtkinter.test.test_tkintertkinter.test.test_tkintertkinter.test.test_ttktkinter.test.test_ttkturtledemoturtledemounicodedataunittestunittestunittest.caseunittest.loaderunittest.mainunittest.resultunittest.runnerunittest.signalsunittest.suiteunittest.testunittest.testunittest.utilurlliburllibwsgirefwsgirefxmlxmlxml.domxml.domxml.dom.domregxml.dom.minicompatxml.etreexml.etreexml.parsersxml.parsersxml.saxxml.saxxml.sax._exceptionsxml.sax.handlerxml.sax.xmlreaderxmlrpcxmlrpcxxsubtype
msg135101 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2011-05-04 08:43
By the way, it is NOT POSSIBLE TO UNLOAD modules implemented in C, even if there is no more Python reference to the module.
msg135110 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2011-05-04 10:35
See also#11998 for test_signal and _tkinter issue (test_pydoc + test_signal).
msg135147 -(view)Author: Arfrever Frehtes Taifersar Arahesis (Arfrever)*(Python triager)Date: 2011-05-04 18:39
It might be possible to use a part of patch for issue#1674555.A newer version of that patch can be found in:http://overlays.gentoo.org/svn/proj/python/overlays/python/dev-lang/python/files/3.3-20110417/23_all_tests_environment.patch
msg135312 -(view)Author: Éric Araujo (eric.araujo)*(Python committer)Date: 2011-05-06 16:02
Isn’t the root problem that pydoc uses import rather than imp orPEP 302 things?  We could change that.
msg135418 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2011-05-07 08:34
> Isn’t the root problem that pydoc uses import rather than imp orPEP 302 things?  We could change that.It's possible to get the documentation of some module without loading them: pydoc already supports get_source() method of a module loader.But my concern is more about C modules: you have to load them to get their documentation, but you can never a unload C modules (you have to exit Python).
msg189547 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2013-05-18 20:35
Here is a patch.
msg189589 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2013-05-19 13:46
New changeset58ace614df6b by Antoine Pitrou in branch '3.3':Issue#11995: test_pydoc doesn't import all sys.path modules anymore.http://hg.python.org/cpython/rev/58ace614df6bNew changeset13d817cb72e7 by Antoine Pitrou in branch 'default':Issue#11995: test_pydoc doesn't import all sys.path modules anymore.http://hg.python.org/cpython/rev/13d817cb72e7
msg189590 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2013-05-19 13:51
New changeset68d2337688c1 by Antoine Pitrou in branch '2.7':Issue#11995: test_pydoc doesn't import all sys.path modules anymore.http://hg.python.org/cpython/rev/68d2337688c1
History
DateUserActionArgs
2022-04-11 14:57:16adminsetgithub: 56204
2013-05-19 13:52:12pitrousetstatus: open -> closed
stage: resolved
resolution: fixed
versions: - Python 3.2
2013-05-19 13:51:21python-devsetmessages: +msg189590
2013-05-19 13:46:46python-devsetnosy: +python-dev
messages: +msg189589
2013-05-18 20:35:52pitrousetfiles: +test_pydoc_imports.patch
versions: + Python 3.4
nosy: +pitrou

messages: +msg189547
2013-01-26 08:44:29eric.snowsetnosy: +eric.snow
2013-01-03 01:44:44Arfreversetfiles: -python-3.3-issue_11995.patch
2013-01-03 01:44:41Arfreversetfiles: -python-3.2-issue_11995.patch
2013-01-03 01:44:36Arfreversetfiles: -python-2.7-issue_11995.patch
2011-05-26 22:06:02Arfreversetversions: + Python 2.7, Python 3.2
2011-05-26 22:05:47Arfreversetfiles: +python-3.3-issue_11995.patch
2011-05-26 22:05:26Arfreversetfiles: +python-3.2-issue_11995.patch
2011-05-26 22:05:02Arfreversetfiles: +python-2.7-issue_11995.patch
keywords: +patch
2011-05-07 08:34:56vstinnersetmessages: +msg135418
2011-05-06 16:02:31eric.araujosetnosy: +eric.araujo
messages: +msg135312
2011-05-04 18:39:41Arfreversetmessages: +msg135147
2011-05-04 17:53:06Arfreversetnosy: +Arfrever
2011-05-04 10:35:34vstinnersetmessages: +msg135110
2011-05-04 08:43:57vstinnersetmessages: +msg135101
2011-05-04 08:29:26vstinnercreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp