mirror of
https://github.com/python/cpython.git
synced 2025-10-20 13:43:01 +00:00
Issue #19205: add debugging output for failing test on Snow Leopard
This commit is contained in:
parent
cbf6e95de5
commit
179a3dbc9e
1 changed files with 12 additions and 7 deletions
|
@ -425,19 +425,24 @@ class StartupImportTests(unittest.TestCase):
|
||||||
def test_startup_imports(self):
|
def test_startup_imports(self):
|
||||||
# This tests checks which modules are loaded by Python when it
|
# This tests checks which modules are loaded by Python when it
|
||||||
# initially starts upon startup.
|
# initially starts upon startup.
|
||||||
args = [sys.executable, '-I', '-c',
|
popen = subprocess.Popen([sys.executable, '-I', '-v', '-c',
|
||||||
'import sys; print(set(sys.modules))']
|
'import sys; print(set(sys.modules))'],
|
||||||
stdout = subprocess.check_output(args)
|
stdout=subprocess.PIPE,
|
||||||
modules = eval(stdout.decode('utf-8'))
|
stderr=subprocess.PIPE)
|
||||||
|
stdout, stderr = popen.communicate()
|
||||||
|
stdout = stdout.decode('utf-8')
|
||||||
|
stderr = stderr.decode('utf-8')
|
||||||
|
modules = eval(stdout)
|
||||||
|
|
||||||
self.assertIn('site', modules)
|
self.assertIn('site', modules)
|
||||||
|
|
||||||
# http://bugs.python.org/issue19205
|
# http://bugs.python.org/issue19205
|
||||||
re_mods = {'re', '_sre', 'sre_compile', 'sre_constants', 'sre_parse'}
|
re_mods = {'re', '_sre', 'sre_compile', 'sre_constants', 'sre_parse'}
|
||||||
self.assertFalse(modules.intersection(re_mods))
|
self.assertFalse(modules.intersection(re_mods), stderr)
|
||||||
# http://bugs.python.org/issue9548
|
# http://bugs.python.org/issue9548
|
||||||
self.assertNotIn('locale', modules)
|
self.assertNotIn('locale', modules, stderr)
|
||||||
# http://bugs.python.org/issue19209
|
# http://bugs.python.org/issue19209
|
||||||
self.assertNotIn('copyreg', modules)
|
self.assertNotIn('copyreg', modules, stderr)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue