ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ 4]c@sddlZddlZddlZddlZddlZddlZddlmZddlmZddlm Z ddlm Z ddlm Z e rdZ e Z Zn.e rd ZeZ ZnejZ d Zd Zd Zd efdYZdZdZdZdZdZdZedZdZdefdYZdddZ dZ!dS(iNi(t decorator(t defaultdict(tjython(tpy2k(tpypycGs/tjtjdtjtjdS(s aggressive gc.collect for tests.g?i(tgctcollectttimetsleep(targs((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytjython_gc_collects     cGstjtjdS(N(RR(R ((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytpypy_gc_collect$s cCsdS(N((((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytlazy_gc-sc#st}trCyddl}|j|WqCtk r?qCXnddl}|j|xE|D]=x4td|jD] jfdfVq|WqcWdS(Niicsj|S(N(tdumps(td(tpickle_tprotocol(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytBt( tsetRtcPickletaddt ImportErrortpickletrangetHIGHEST_PROTOCOLtloads(tpicklersRR((RRsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyR1s      cCsNt|trt||S|tjdd|jtjtd|S(Nt1t0i (t isinstancetfloattroundtdecimaltDecimalt to_integralt ROUND_FLOORtpow(tvaluetprec((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyt round_decimalEs   t RandomSetcBs>eZdZdZdZdZdZdZRS(cCs,ttj|}tj|t|S(N(tlistRt__iter__trandomtshuffletiter(tselftl((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyR+Ps cCsFtjdt|d}ttj||}|j||S(Nii(R,trandinttlenR*RR+tremove(R/tindextitem((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytpopUs cCsttj||S(N(R)Rtunion(R/tother((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyR7[scCsttj||S(N(R)Rt difference(R/R8((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyR9^scCsttj||S(N(R)Rt intersection(R/R8((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyR:ascCs t|S(N(R)(R/((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytcopyds(t__name__t __module__R+R6R7R9R:R;(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyR)Os      cCstt}x%|D]\}}||j|qWxGt|D]5\}}x&||D]}|||krXtSqXWqAWtSdS(sATrue if the given sorting conforms to the given partial ordering.N(RRRt enumeratetFalsetTrue(ttuplestsorted_elementstdepstparenttchildtitnodetn((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytconforms_partial_orderinghs  csVttx%|D]\}}|j|qWfdt|S(Nc3st|dkr t|Vnbx_|D]W}t|j|g}|j|s'x#|D]}|g|VqeWq'q'WdS(Ni(R2R*RR9R:(telementstelemtsubsett sub_ordering(t_all_orderingstedges(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyRN{s (RRRR.(RARJRDRE((RNROsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytall_partial_orderingsvs   cCsLy ||_Wn8tk rGtj|j|j||j|j}nX|S(scReturn a function with a given __name__. Will assign to __name__ and return the original function if possible on the Python implementation, otherwise a new function will be constructed. This function should be phased out as much as possible in favor of @decorator. Tests that "generate" many named tests should be modernized. (R<t TypeErrorttypest FunctionTypet__code__t __globals__t __defaults__t __closure__(tfntname((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytfunction_nameds   %cOsr|j}y-||||}|jddd|SWn2tj}|j|}|sfqn|SnXdS(sRun the given function under the given contextmanager, simulating the behavior of 'with' to support older Python versions. This is not necessary anymore as we have placed 2.6 as minimum Python version, however some tests are still using this structure. N(t __enter__t__exit__tNonetsystexc_info(tctxRXtargtkwtobjtresultR_traise_((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytrun_as_contextmanagers  cCsd|DS(sConverts the results of sql execution into a plain set of column tuples. Useful for asserting the results of an unordered query. cSsh|]}t|qS((ttuple(t.0trow((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pys s ((tresults((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytrowsetscCstst|dS(N(R?tAssertionError(tmsg((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytfailsc Osddlm}ddlm}ddlm}|j|j}|d}t|dd}||_ z|||SWd|j ||j||_ XdS( s>Provide bound MetaData for a single test, dropping afterwards.i(tconfig(tenginesi(tschemaitmetadataN( RRoRpt sqlalchemyRqtMetaDatatdbtgetattrR]Rrtdrop_all_tables( RXR RbRoRpRqRrR/t prev_meta((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytprovide_metadatas  cs?ddlmddlmtfd}|S(siForce the given table names to be dropped after test complete, isolating for foreign key cycles i(Roi(tinspectcs8z|||SWdtjjdXdS(Nt include_names(RwRu(RXR Rb(RoRztnames(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytgos(RRoRsRzR(R|R}((RoRzR|sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytforce_drop_namesstadictcBs&eZdZdZdZeZRS(s,Dict keys available as attributes. Shadows.cCs1y ||SWntk r,tj||SXdS(N(tKeyErrortdictt__getattribute__(R/tkey((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyRs  cGs!tg|D]}||^q S(N(Rg(R/tkeysR((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyt__call__s(R<R=t__doc__RRtget_all(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyRs  c Csddlm}m}m}m}m}ddlm} m} |dk rYt |}n|j 0} x&t |j d|D] \} } | r|dk r| |krqn| j| || |d|q| r|jjsqnx| D]\} }|dk r"| |kr"qn|| ||d||d|d|}| j| ||jjg|jjgd|qWqqWWdQXdS(Ni(tColumntTabletIntegerRttForeignKeyConstraint(t DropTabletDropConstraintRqtxtyRY(RsRRRRtRtsqlalchemy.schemaRRR]Rtconnecttreversedtget_sorted_table_and_fkc_namestexecutetdialecttsupports_altertcRR(tenginet inspectorRqR{RRRRtRRRtconnttnametfkcstfkcttb((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyRws8( "     cstfd}|S(Ncs#z|||SWdjXdS(N(t_clear(RXRaRb(t event_cls(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytdecorate's(R(RR((RsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pytteardown_events&s("R!RR,R^RRRtutilRRRRRR t gc_collectR R RRR(RR)RIRPRZRfRkRnRyR~RRR]RwR(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/util.pyts@                   .