This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pablogsal, serhiy.storchaka, shihai1991, terry.reedy, vstinner, zach.ware
Date 2021-03-19.17:45:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1616175920.11.0.508864208837.issue41718@roundup.psfhosted.org>
In-reply-to
Content
Serhiy: "You could save/restore this data only when corresponded modules was imported, like it was done in clear_caches() in refleak.py."

That's a very good idea! I implemented it in PR 24934. But I modified runtest() to use *two* saved_test_environment instance. One before the test module is imported, one after. The one before is needed to check if the import itself has side effect, for example if the module body has side effect. The second is to check if running tests has side effect. The second one is more likely to have modules imported. The first one may miss some bugs, but IMO it's an acceptable trade-off.
History
Date User Action Args
2021-03-19 17:45:20vstinnersetrecipients: + vstinner, terry.reedy, zach.ware, serhiy.storchaka, pablogsal, shihai1991
2021-03-19 17:45:20vstinnersetmessageid: <1616175920.11.0.508864208837.issue41718@roundup.psfhosted.org>
2021-03-19 17:45:20vstinnerlinkissue41718 messages
2021-03-19 17:45:19vstinnercreate