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 eli.collins
Recipients Arfrever, berker.peksag, brett.cannon, eli.collins, eric.snow, ncoghlan, pitrou, robertmuil, stefanv, yaubi
Date 2015-07-26.15:14:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm not sure how generally applicable this is, but it might be useful as a starting point:  Attached is a bit of code I've been using: it's a reset_warnings_registry() context manager, which backs up & clears the registry state for the duration of the context, then restores it afterwards.  

It's particularly useful for unittests, just create & call the __enter__() method during setUp(), and attach __exit__() via addCleanup.  Each test is then gets it's own isolated warnings registry.
Date User Action Args
2015-07-26 15:14:03eli.collinssetrecipients: + eli.collins, brett.cannon, ncoghlan, pitrou, Arfrever, stefanv, yaubi, eric.snow, berker.peksag, robertmuil
2015-07-26 15:14:03eli.collinssetmessageid: <>
2015-07-26 15:14:03eli.collinslinkissue21724 messages
2015-07-26 15:14:03eli.collinscreate