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
_tkinter
array
atexit
bdb
binascii
bz2
cmd
code
codeop
concurrent
concurrent
concurrent.futures
concurrent.futures
concurrent.futures._base
concurrent.futures.process
concurrent.futures.thread
contextlib
copy
ctypes
ctypes
ctypes._endian
ctypes.macholib
ctypes.macholib
ctypes.test
ctypes.test
curses
curses
curses.wrapper
datetime
dbm
dbm
difflib
distutils
distutils
distutils.command
distutils.command
distutils.tests
distutils.tests
doctest
email
email
email.mime
email.mime
encodings.cp1252
encodings.idna
encodings.koi8_r
faulthandler
fcntl
fnmatch
gc
getopt
gettext
grp
hashlib
html
html
http
http
idlelib
idlelib
importlib
importlib
importlib._bootstrap
importlib.test
importlib.test
importlib.test.builtin
importlib.test.builtin
importlib.test.extension
importlib.test.extension
importlib.test.frozen
importlib.test.frozen
importlib.test.import_
importlib.test.import_
importlib.test.source
importlib.test.source
json
json
json.decoder
json.encoder
json.scanner
lib2to3
lib2to3
lib2to3.btm_matcher
lib2to3.btm_utils
lib2to3.fixer_base
lib2to3.fixer_util
lib2to3.fixes
lib2to3.fixes
lib2to3.fixes.fix_imports
lib2to3.fixes.fix_imports2
lib2to3.fixes.fix_urllib
lib2to3.main
lib2to3.patcomp
lib2to3.pgen2
lib2to3.pgen2
lib2to3.pgen2.driver
lib2to3.pgen2.grammar
lib2to3.pgen2.literals
lib2to3.pgen2.parse
lib2to3.pgen2.pgen
lib2to3.pgen2.token
lib2to3.pgen2.tokenize
lib2to3.pygram
lib2to3.pytree
lib2to3.refactor
lib2to3.tests
lib2to3.tests
lib2to3.tests.support
lib2to3.tests.test_all_fixers
lib2to3.tests.test_fixers
lib2to3.tests.test_main
lib2to3.tests.test_parser
lib2to3.tests.test_pytree
lib2to3.tests.test_refactor
lib2to3.tests.test_util
logging
logging
logging.handlers
marshal
math
msilib
msilib
multiprocessing
multiprocessing
multiprocessing.dummy
multiprocessing.dummy
multiprocessing.dummy.connection
multiprocessing.forking
multiprocessing.process
multiprocessing.queues
multiprocessing.synchronize
multiprocessing.util
myfixes
myfixes
optparse
pdb
pickle
pprint
pwd
pydoc_data
pydoc_data
queue
random
select
shutil
socket
sqlite3
sqlite3
sqlite3.dbapi2
sqlite3.test
sqlite3.test
stringprep
struct
subprocess
tarfile
tempfile
test
test
test.encoded_modules
test.encoded_modules
test.json_tests
test.json_tests
test.leakers
test.leakers
test.support
test.test_email
test.test_email
test.tracedmodules
test.tracedmodules
textwrap
threading
tkinter
tkinter
tkinter.constants
tkinter.test
tkinter.test
tkinter.test.test_tkinter
tkinter.test.test_tkinter
tkinter.test.test_ttk
tkinter.test.test_ttk
turtledemo
turtledemo
unicodedata
unittest
unittest
unittest.case
unittest.loader
unittest.main
unittest.result
unittest.runner
unittest.signals
unittest.suite
unittest.test
unittest.test
unittest.util
urllib
urllib
wsgiref
wsgiref
xml
xml
xml.dom
xml.dom
xml.dom.domreg
xml.dom.minicompat
xml.etree
xml.etree
xml.parsers
xml.parsers
xml.sax
xml.sax
xml.sax._exceptions
xml.sax.handler
xml.sax.xmlreader
xmlrpc
xmlrpc
xxsubtype
|