Gregory P. Smith <g...@krypto.org> added the comment:

I can make the test reliable... but I wouldn't say I fully understand the 
ultimate cause of the problem.

The reliability fix for test_pkg is to stop using test.support.modules_setup() 
and test.support.modules_cleanup() in the setUp() and tearDown() methods.

these test support functions are semi scary.  they attempt to backup and 
replace sys.modules contents with special case code in the cleanup function to 
try and avoid doing that to things that are still necessary.

running python -vvv when I could get test_pkg to fail led me looking at code 
paths that were being executed mid-test that i'd expect to be executed only on 
process startup.  locale.getpreferredencoding triggering a _bootlocale import, 
etc.  I don't understand why it cause the problem though.

PR to at least make the test reliable coming.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34200>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to