Message11216

Author jeff.allen
Recipients jeff.allen
Date 2017-03-10.20:35:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489178146.86.0.0502789944178.issue2567@psf.upfronthosting.co.za>
In-reply-to
Content
I discovered this trying to re-enable test_jsr223. The ostensible symptom is that regrtest mysteriously becomes verbose:

> dist\bin\jython -m test.regrtest test_binhex test_jsr223 test_binhex
test_binhex
test_jsr223
C:\Users\Jeff\Documents\Eclipse\jython-trunk\dist\Lib\test\regrtest.py:679: RuntimeWarning: Parent module 'test' not found while handling absolute import
  import shutil
test_binhex
C:\Users\Jeff\Documents\Eclipse\jython-trunk\dist\Lib\test\regrtest.py:578: RuntimeWarning: Parent module 'test' not found while handling absolute import
  from test.junit_xml import Tee, write_direct_test
test_binhex (test.test_binhex.BinHexTestCase) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.029s

OK
All 3 tests OK.

But note also the warnings about having lost the 'test' module. Under pdb one may show that, after the JSR-223 test runs, and at the time of these imports, sys.modules and the module list that the import mechanism uses are different:
(Pdb) l
575         if verbose:
576             capture_stdout = None
577         else:
578             capture_stdout = cStringIO.StringIO()
579
580  ->     from test.junit_xml import Tee, write_direct_test
581         try:
582             save_stdout = sys.stdout
583
584             indirect_test = None
585             if junit_xml_dir:
(Pdb) gss = sys.modules['org'].__dict__['python'].__dict__['core'].Py.getSystemState()
(Pdb) id(sys)
198
(Pdb) id(gss)
202
(Pdb) len(sys.modules.keys()) - len(gss.modules.keys())
139
(Pdb)

When test_jsr233 is reduced to just initialising the engine:
    engine = ScriptEngineManager().getEngineByName("python")
we still get this result. (It's nothing in the test itself.)
History
Date User Action Args
2017-03-10 20:35:46jeff.allensetrecipients: + jeff.allen
2017-03-10 20:35:46jeff.allensetmessageid: <1489178146.86.0.0502789944178.issue2567@psf.upfronthosting.co.za>
2017-03-10 20:35:46jeff.allenlinkissue2567 messages
2017-03-10 20:35:45jeff.allencreate