bgddlZddlmZmZddlmZmZeeeefZ Gddej Z Gdde Z dS)N)UnionType) Comparisoncomparec@eZdZdZdZdeffd ZfdZfdZxZ S) ShouldWarna  This context manager is used to assert that warnings are issued within the context it is managing. :param expected: This should be a sequence made up of one or more elements, each of one of the following types: * A warning class, indicating that the type of the warnings is important but not the parameters it is created with. * A warning instance, indicating that a warning exactly matching the one supplied should have been issued. If no expected warnings are passed, you will need to inspect the contents of the list returned by the context manager. :param filters: If passed, these are used to create a filter such that only warnings you are interested in will be considered by this :class:`ShouldWarn` instance. The names and meanings are the same as the parameters for :func:`warnings.filterwarnings`. Fexpectedctt|dd|D|_||_dS)NT)recordc,g|]}t|S)C).0es h/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/testfixtures/shouldwarn.py z'ShouldWarn.__init__..)s000!1000)superr__init__r filters)selfr r __class__s rrzShouldWarn.__init__'sD j$(((55500x000  rctt||_t jdi|j|jS)Nalways)r)rr __enter__recordedwarningsfilterwarningsrrrs rrzShouldWarn.__enter__,sAj$//99;; 99DL999}rctt|||||js |jrdS|js|jr |jsdSt |jd|jDdS)Ncg|] }|j Sr )message)rwms rrz'ShouldWarn.__exit__..7s&J&J&Jbrz&J&J&Jr)actual)rr__exit__r _empty_okayr r)rexc_typeexc_valexc_tbrs rr%zShouldWarn.__exit__1s j$((7FCCC} !1  F}  t7G  F &J&JDM&J&J&JKKKKKKr) __name__ __module__ __qualname____doc__r& WarningOrTyperrr% __classcell__rs@rrr s4K-  LLLLLLLLLrrc&eZdZdZdZfdZxZS) ShouldNotWarnzs This context manager is used to assert that no warnings are issued within the context it is managing. TcVtt|dS)N)rr2rrs rrzShouldNotWarn.__init__Bs% mT""++-----r)r*r+r,r-r&rr/r0s@rr2r2:sI K.........rr2) rtypingrr testfixturesrrrWarningr.catch_warningsrr2r rrr8s11111111gtG},- -L-L-L-L-L(-L-L-L` . . . . .J . . . . .r