Terry J. Reedy <tjre...@udel.edu> added the comment:
On Windows with current master, the baseline for running anything with 1 import (">>> import sys; len(sys.modules)") is 35 imported modules. Adding "import unittest" increases this to 80. What slightly puzzles me is that running --- import unittest import sys class Tests(unittest.TestCase): def test_bug(self): print("len(sys.modules):", len(sys.modules)) if __name__ == "__main__": unittest.main() --- increases the number to 90. Perhaps unittest has delayed imports. The current startup number for IDLE is 162, which can result in a cold startup of several seconds. I am thinking of trying to reduce this by delaying imports of modules that are not immediately used and might never be used. For tests, I gather that side-effect issues are more important than startup time. ---------- nosy: +terry.reedy _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41718> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com