mς SγΈEc@s dkZdfd„ƒYZdS(Nt WarningsHookcBs;tZdZd„Zd„Zd„Zd„Zd„ZRS(sˆHook to capture warnings generated by Python. The function warnings.showwarning() is designed to be hooked by application code, allowing the application to customize the way it handles warnings. This hook captures the unformatted warning information and stores it in a list. A test can inspect this list after the test is over. Issues: The warnings module has lots of delicate internal state. If a warning has been reported once, it won't be reported again. It may be necessary to extend this class with a mechanism for modifying the internal state so that we can be guaranteed a warning will be reported. If Python is run with a warnings filter, e.g. python -Werror, then a test that is trying to inspect a particular warning will fail. Perhaps this class can be extended to install more-specific filters the test to work anyway. cCsd|_g|_dS(N(tNonetselftoriginaltwarnings(R((t2/data/zmath/zope/lib/python/ZODB/tests/warnhook.pyt__init__(s cCsti|_|it_dS(N(Rt showwarningRR(R((Rtinstall,s cCs0|idj pt‚|it_d|_dS(N(RRRtAssertionErrorRR(R((Rt uninstall0s cCs&|iit|ƒ|||fƒdS(N(RRtappendtstrtmessagetcategorytfilenametlineno(RR RRR((RR5scCs g|_dS(N(RR(R((Rtclear8s(t__name__t __module__t__doc__RRR RR(((RRs     (RR(RR((Rt?s