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 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 <>
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 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. 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.)
Date User Action Args
2015-04-01 12:05:04vstinnersetrecipients: + vstinner, pitrou, ezio.melotti, michael.foord, serhiy.storchaka
2015-04-01 12:05:04vstinnersetmessageid: <>
2015-04-01 12:05:04vstinnerlinkissue23839 messages
2015-04-01 12:05:03vstinnercreate