Author vstinner
Recipients ezio.melotti, michael.foord, pitrou, serhiy.storchaka, vstinner
Date 2015-04-01.12:05:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427889904.27.0.622177946525.issue23839@psf.upfronthosting.co.za>
In-reply-to
Content
Maybe tests known to fill caches should clear theirself caches at cleanup? Always clearing all caches may have an impact on performances and so makes tests longer. Caches are designed to speedup Python :-)

We may add some helper functions in test.support for the most common caches, but not to clear *all* caches.

By the way, forcing calls to gc.collect() may make tests more reliable. It would avoid to get warnings 4 lines after the test leaking a resource finished.

But it's not easy to make this reliable, because unittest stores a lot of things. unittest.TestCase.run() stores exceptions which store a traceback which stores frames which store references to local variables. Instead of storing a whole sys.exc_info(), we can maybe use the new light traceback.TracebackException which only stores info required to format a traceback as text, without storing all these heavily objects creating reference cycles.

(Hum, it becomes a little off-topic, sorry, we may open a new separated issue.)
History
Date User Action Args
2015-04-01 12:05:04vstinnersetrecipients: + vstinner, pitrou, ezio.melotti, michael.foord, serhiy.storchaka
2015-04-01 12:05:04vstinnersetmessageid: <1427889904.27.0.622177946525.issue23839@psf.upfronthosting.co.za>
2015-04-01 12:05:04vstinnerlinkissue23839 messages
2015-04-01 12:05:03vstinnercreate