Message247432
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:03 | eli.collins | set | recipients:
+ eli.collins, brett.cannon, ncoghlan, pitrou, Arfrever, stefanv, yaubi, eric.snow, berker.peksag, robertmuil |
2015-07-26 15:14:03 | eli.collins | set | messageid: <1437923643.36.0.0677754862636.issue21724@psf.upfronthosting.co.za> |
2015-07-26 15:14:03 | eli.collins | link | issue21724 messages |
2015-07-26 15:14:03 | eli.collins | create | |
|