U kf0@s`ddlZddlZddlZddlZddlmZddlmZddlmZddlm Z d8dd Z d9d d Z Gd d d Z d:ddZ d;ddZGdddZGdddeZGdddeZGdddeZGdddeZGdddeZejZddZd d!Zd"d#Zd$d%Zd&d'Zdd0d1Z d?d2d3Z!d@d4d5Z"d6d7Z#dS)ANconfig)util) decorator)inspect_getfullargspeccCs t}t||}|j||SN)compound _as_predicateskipsadd predicatereasonrulepredrM/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/testing/exclusions.pyskip_ifs  rcCs t}t||}|j||Sr )r r failsr rrrrfails_ifs  rc@seZdZddZddZddZddZd d Zed d Z d dZ ddZ ddZ ddZ ejddZddZdddZd ddZdS)!r cCst|_t|_dSr )setrr selfrrr__init__#szcompound.__init__cCs ||Sr )r rotherrrr__add__'szcompound.__add__cCs&t}|j|j|j|j|Sr )r r updater)rrrrras_skips*szcompound.as_skipscGsLt}|j|j|j|j|D] }|j|j|j|jq&|Sr r rrr )rZotherscopyrrrrr 0sz compound.addcCs:t}|jdd|jD|jdd|jD|S)Ncss|]}t|VqdSr  NotPredicate.0failrrr <sz compound.not_..css|]}t|VqdSr r#)r&skiprrrr(=sr!)rr"rrrnot_:sz compound.not_cCs |tjSr )enabled_for_configr_currentrrrrenabled@szcompound.enabledcCs&|j|jD]}||rdSqdS)NFTr unionr)rrrrrrr+Dszcompound.enabled_for_configcsfdd|j|jDS)Ncsg|]}|r|qSr _as_string)r&rrrr Lsz4compound.matching_config_reasons..r.rrrrrmatching_config_reasonsKs  z compound.matching_config_reasonscCs |j|j|j|jdSr )r rrrrrr_extendRszcompound._extendcs<t|dr|j|Stfdd}||}|_|S)N_sa_exclusion_extendcsjtj|f||Sr )_dorr,)fnargskwrrrdecorate[sz#compound.__call__..decorate)hasattrr6r5r)rr8r;Z decoratedrrr__call__Vs  zcompound.__call__c csht}|j|j|jz dVWn0tk rV}z|tj|W5d}~XYnX| tjdSr ) r rrr r/ Exception_expect_failurerr,_expect_success)rZ all_failsexrrrfail_ifcs  zcompound.fail_ifc Os|jD],}||rdt||f}t|qz|||}Wn4tk rv}z|j|||jdW5d}~XYnX|j||jd|SdS)Nz '%s' : %s)name) r rZget_current_test_namer1Z skip_testr>r?__name__r@) rcfgr8r9r:r)msgZ return_valuerArrrr7os  $z compound._doblockcCsF|jD](}||rtd||||fqBq|tddS)Nz%s failed as expected (%s): %s r)rprintr1with_tracebacksysexc_info)rrrArCr'rrrr?s zcompound._expect_failurec sH|js dS|jD]2}|rtd|dfdd|jDfqdS)Nz Unexpected success for '%s' (%s) and c3s|]}|VqdSr r0r%rrrr(sz+compound._expect_success..)rAssertionErrorjoin)rrrCr'rrrr@s zcompound._expect_successN)rG)rG)rD __module__ __qualname__rrr r r*propertyr-r+r4r5r= contextlibcontextmanagerrBr7r?r@rrrrr "s      r cCst|}tt||Sr )r rr$rrrrronly_ifsrUcCst|}tt||Sr )r rr$rTrrr succeeds_ifsrVc@s.eZdZed ddZd ddZd ddZdS) PredicateNcst|tr|j|St|tr:|r6|jdkr6||_|St|ttfr`tfdd|D|St|t rrt |St|t rt d|}|std||d}|d}|drt dd |dd Dnd}t ||||d St|rt||Sd std |dS)Ncsg|]}|qSr) as_predicate)r&rclsrrr2sz*Predicate.as_predicate..z.([\+\w]+)\s*(?:(>=|==|!=|<=|<|>)\s*([\d\.]+))?z(Couldn't locate DB name in predicate: %rrrcss|]}t|VqdSr )int)r&drrrr(sz)Predicate.as_predicate...) descriptionFzunknown predicate type: %s) isinstancer rXr+rWr_listr OrPredicatetuple SpecPredicatestrrematch ValueErrorgroupsplitcallableLambdaPredicaterM)rZrr_tokensdbopspecrrYrrXs@         zPredicate.as_predicateFcCsV||}|r| }|j|r&|jjnd|r8|jjnd|rBdnd|rLdnddS)Nz z zdoesn't supportz does support)driverZdatabaseZdoesnt_supportZ does_support)r_rnurlZget_driver_nameZget_backend_name)rrnegateZbool_rrr_format_descriptions  zPredicate._format_descriptioncCs tdSr )NotImplementedErrorrrrsrrrr1szPredicate._as_string)N)F)NF)rDrOrP classmethodrXrtr1rrrrrWs # rWc@s(eZdZd ddZddZd ddZdS) BooleanPredicateNcCs||_|pd||_dS)Nz boolean %s)valuer_)rryr_rrrrszBooleanPredicate.__init__cCs|jSr )ryr3rrrr=szBooleanPredicate.__call__FcCs|j||dS)Nrsrtrvrrrr1szBooleanPredicate._as_string)N)FrDrOrPrr=r1rrrrrxs rxc @sPeZdZd ddZejejejejej ej ej dddZ ddZ d d d ZdS)rdNcCs||_||_||_||_dSr )rnrorpr_)rrnrorpr_rrrrszSpecPredicate.__init__cCs||dko||dkS)Nrrr)valpairrrrzSpecPredicate.)<>z==z!=z<=z>=inZbetweencCs|dkr dS|j}d|jkr.|jd\}}n |jd}}|rL|j|krLdS|dk rb|j|krbdS|jdk r|dks|tdt|}t|jdr|jp|j|j}|||j SdSdS)NF+z%DBAPI version specs not supported yetr=T) rnrjrCrqrorM_server_versionr<_opsrp)rrenginedialectrqversionoperrrrr=s"    zSpecPredicate.__call__FcCsh|jdk r||S|jdkr8|r,d|jSd|jSn,|rPd|j|j|jfSd|j|j|jfSdS)Nznot %sz%sz not %s %s %sz%s %s %s)r_rtrornrprvrrrr1s     zSpecPredicate._as_string)NNN)F)rDrOrProperatorltgteqnelegecontainsrr=r1rrrrrds  rdc@s(eZdZd ddZddZd ddZdS) rlNcs`t}|ds fdd|_n|_|p,d|_|p6i|_|rF||_njrVj|_nd|_dS)NrcsSr r)rnlambda_rrr*rz*LambdaPredicate.__init__..rzcustom function)rrr9r:r___doc__)rrr_r9r:rprrrr's   zLambdaPredicate.__init__cCs ||Sr rr3rrrr=6szLambdaPredicate.__call__FcCs ||Sr r{rvrrrr19szLambdaPredicate._as_string)NNN)Fr|rrrrrl&s rlc@s(eZdZd ddZddZd ddZdS) r$NcCs||_||_dSr )rr_)rrr_rrrr>szNotPredicate.__init__cCs || Sr )rr3rrrr=BszNotPredicate.__call__FcCs(|jr||| S|j|| SdSr )r_rtrr1rvrrrr1EszNotPredicate._as_string)N)Fr|rrrrr$=s r$c@s:eZdZd ddZddZdddZd d Zdd d ZdS)rbNcCs||_||_dSr ) predicatesr_)rrr_rrrrMszOrPredicate.__init__cCs|jD]}||rdSqdS)NTF)r)rrrrrrr=Qs zOrPredicate.__call__Fcs*r d}nd}|fdd|jDS)NrLz or c3s|]}|jdVqdS)rzNr0)r&prrsrrr(\sz(OrPredicate._eval_str..)rNr)rrrsZ conjunctionrrr _eval_strWs zOrPredicate._eval_strcCs*|jdk rd||S|j|ddSdS)NzNot Trz)r_rtrr3rrr _negation_str`s zOrPredicate._negation_strcCs0|r||S|jdk r"||S||SdSr )rr_rtrrvrrrr1fs    zOrPredicate._as_string)N)F)F)rDrOrPrr=rrr1rrrrrbLs   rbcCst|||tjSr )rdrr,)rnrorprrr _is_excludedssrcCs.|}t|jdd}|dkr"d}||S)z#Return a server_version_info tuple.Zserver_version_infoNr)connectgetattrrclose)rconnrrrrrws rcGstdd|DS)NcSsg|]}t|qSrrWrXr&rnrrrr2szdb_spec..)rbdbsrrrdb_specsrcCsttddS)NFzmark as executerrxrrrropensrcCsttddS)NTzmarked as skiprrrrrclosedsrcCsttd|p dS)NTzexpected to failrrxrrrrrsrcCsttddS)NTzFuture featurerrrrrfuturesrcCs t||Sr )rrnrrrrfails_onsrcGsttdd|DS)NcSsg|]}t|qSrrrrrrr2sz.fails_on_everything_except..)rVrbrrrrfails_on_everything_exceptsrcCs t||Sr )rrrrrr)sr)cs ttfddt|DS)Ncsg|]}t|qSrrrrrrr2szonly_on..)rUrbrZto_list)rrrrronly_ons rcCstt||||Sr )rrd)rnrorprrrrexcludesrcGs"|s tdtdd|D|S)Nzno queries sent!cSsg|]}t|qSrr)r&queryrrrr2szagainst..)rMrb)rZqueriesrrragainsts r)N)N)N)N)N)N)N)N)N)$rRrrfrJrrrZ util.compatrrrr rUrVrWrxrdrlr$rbrXr rrrrrrrrrr)rrrrrrr s@      z  8 <$