cpython: a57dfbba91f9 (original) (raw)
Mercurial > cpython
changeset 86220:a57dfbba91f9
Issue #19205: add debugging output for failing test on Snow Leopard [#19205]
Christian Heimes christian@cheimes.de | |
---|---|
date | Sat, 12 Oct 2013 12:32:21 +0200 |
parents | 64d9569b4e1f |
children | 000a3f7487a5 |
files | Lib/test/test_site.py |
diffstat | 1 files changed, 12 insertions(+), 7 deletions(-)[+] [-] Lib/test/test_site.py 19 |
line wrap: on
line diff
--- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -425,19 +425,24 @@ class StartupImportTests(unittest.TestCa def test_startup_imports(self): # This tests checks which modules are loaded by Python when it # initially starts upon startup.
args = [sys.executable, '-I', '-c',[](#l1.7)
'import sys; print(set(sys.modules))'][](#l1.8)
stdout = subprocess.check_output(args)[](#l1.9)
modules = eval(stdout.decode('utf-8'))[](#l1.10)
popen = subprocess.Popen([sys.executable, '-I', '-v', '-c',[](#l1.11)
'import sys; print(set(sys.modules))'],[](#l1.12)
stdout=subprocess.PIPE,[](#l1.13)
stderr=subprocess.PIPE)[](#l1.14)
stdout, stderr = popen.communicate()[](#l1.15)
stdout = stdout.decode('utf-8')[](#l1.16)
stderr = stderr.decode('utf-8')[](#l1.17)
modules = eval(stdout)[](#l1.18)
+ self.assertIn('site', modules) # http://bugs.python.org/issue19205[](#l1.22) re_mods = {'re', '_sre', 'sre_compile', 'sre_constants', 'sre_parse'}
self.assertFalse(modules.intersection(re_mods))[](#l1.24)
self.assertFalse(modules.intersection(re_mods), stderr)[](#l1.25) # http://bugs.python.org/issue9548[](#l1.26)
self.assertNotIn('locale', modules)[](#l1.27)
self.assertNotIn('locale', modules, stderr)[](#l1.28) # http://bugs.python.org/issue19209[](#l1.29)
self.assertNotIn('copyreg', modules)[](#l1.30)
self.assertNotIn('copyreg', modules, stderr)[](#l1.31)