@WapUddlmZddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl mZddl mZdd l mZdd l mZdd l mZdd l mZdd l mZddlmZddlmZdZdZdZdZdZ d&dZGddZej d&dZ!d'dZ"d'dZ#d(dZ$iZ%de&d <d!Z'd"Z(d#Z)d$Z*d%Z+dS))) annotationsN)Any)Dict)exc)default)_expect_warnings)eq_)is_)is_false)is_not_)is_true)ne_ decorator) sqla_compatc`|j|jur|jsJd|d|jddSdS)aHassert that any exception we're catching does not have a __context__ without a __cause__, and that __suppress_context__ is never set. Python 3 will report nested as exceptions as "during the handling of error X, error Y occurred". That's not what we want to do. we want these exceptions in a cause chain. Fz Exception z> was correctly raised but did not set a cause, within context z as its cause.N) __context__ __cause____suppress_context__) exceptions /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/alembic/testing/assertions.py _assert_proper_exception_contextrs] Y%888. 9  yy)/// 1  u 9888c*t||||dS)NT check_context_assert_raises except_cls callable_argskws r assert_raisesr%,s *ir N N NNrc&t||||SNrr s rassert_raises_context_okr(0s *ir : ::rc,t|||||dS)NTmsgrrr!r+r"r#kwargss rassert_raises_messager.4s& ItVD   rc*t|||||S)N)r+rr,s r assert_raises_message_context_okr0:s *iv3 G G GGrFcrt|||5}||i|dddn #1swxYwY|jSr')_expect_raiseserror)r!r"r#r-r+recs rrr@s  C 7 7#2 4"6"""############### 8Os '++ceZdZUdZded<dS)_ErrorContainerNrr3)__name__ __module__ __qualname__r3__annotations__rrr6r6Is#Err6c#Kt}|rtjd} |Vd}n#|$r}||_d}| 2 ,S 1 1 1 c#hhoog&&''''''''( 99999799s4C B CC Tc$t||S)Nrr2)r!rs r expect_raisesrJbs *M B B BBrc&t|||S)Nr*rI)r!r+rs rexpect_raises_messagerLfs *#] K K KKrctjdd|}tjdd|}tjdd|}tjdd|}||ksJ|p|d|dS)Nz^\s+?|\nz {2,} z != )r?sub)abr+s req_ignore_whitespacerSjsu {B""A xa  A {B""A xa  A 6663-11-66666rzDict[Any, Any] _dialect_modsc||dkrtjStj|}|dkrd|_n |dkrd|_|S)Nr postgresqlTmssqlF)rDefaultDialectr _create_url get_dialectimplicit_returninglegacy_schema_aliasing)nameds r _get_dialectr_wsr |ty((%''' 8K #D ) ) 5 5 7 7 9 9 <  #'A W__',A $rc(tt|fi|S)aContext manager which expects one or more warnings. With no arguments, squelches all SAWarnings emitted via sqlalchemy.util.warn and sqlalchemy.util.warn_limited. Otherwise pass string expressions that will match selected warnings via regex; all non-matching warnings are sent through. The expect version **asserts** that the warnings were in fact seen. Note that the test suite sets SAWarning warnings to raise exceptions. )rWarningmessagesr$s rexpect_warningsrds GX 4 4 4 44rc,tfd}|S)zDecorator form of expect_warnings(). Note that emits_warning does **not** assert that the warnings were in fact seen. crttgRddi5||i|cdddS#1swxYwYdS)Nassert_F)rDeprecationWarning)fnr#r$rcs rdecoratez2emits_python_deprecation_warning..decorates 0 K( K K K% K K # #2t?r?? # # # # # # # # # # # # # # # # # #s ,00r)rcrjs` r emits_python_deprecation_warningrks/####Y# Orc2ttj|fi|Sr')rsa_excSADeprecationWarningrbs rexpect_sqlalchemy_deprecatedros F7 H HR H HHrc2ttj|fi|Sr')rrmRemovedIn20Warningrbs rexpect_sqlalchemy_deprecated_20rrs F5x F F2 F FFr)NF)Tr'), __future__r contextlibr?r=typingrr sqlalchemyrrmsqlalchemy.enginersqlalchemy.testing.assertionsrr r r r r rsqlalchemy.utilrutilrrr%r(r.r0rr6contextmanagerr2rJrLrSrTr:r_rdrkrorrr;rrr|s""""""" $$$$$$%%%%%%::::::------------222222111111111111------%%%%%%   *OOO;;; HHHBG ::::(CCCCLLLL....!# """"    5 5 5    IIIGGGGGr