Oh, I just remember this old issue which is somehow similar: http://bugs.python.org/issue11995 "test_pydoc loads all Python modules" Running test_pydoc in a subprocess would work around this issue. Arfrever wrote a patch, I didn't read it (sorry!). Victor