Files
Home-AssistantConfig/deps/sqlalchemy/testing/plugin/__pycache__/plugin_base.cpython-34.pyc

81 lines
15 KiB
Plaintext
Raw Normal View History

2016-10-11 16:42:06 +00:00
<EFBFBD>
}<7D><>W<EFBFBD>C<00>@s<>dZddlmZddlZddlZejdQkZerRddlZn ddlZda da
da da da dadZdadadadadae<00>ae<00>adadd<00>Zdd<00>Zd d
<00>Zd d <00>Zd d<00>Zdd<00>Zdd<00>Zda dd<00>Z!dd<00>Z"dd<00>Z#dd<00>Z$dd<00>Z%dd<00>Z&dd <00>Z'gZ(gZ)d!d"<00>Z*d#d$<00>Z+e*d%d&<00><00>Z,e*d'd(<00><00>Z-e+d)d*<00><00>Z.e+d+d,<00><00>Z/e+d-d.<00><00>Z0d/d0<00>Z1e+d1d2<00><00>Z2e+d3d4<00><00>Z3e+d5d6<00><00>Z4e+d7d8<00><00>Z5d9d:<00>Z6d;d<<00>Z7d=d><00>Z8d?d@<00>Z9dAdB<00>Z:dCdD<00>Z;dEdF<00>Z<dGdH<00>Z=dIdJ<00>Z>ddKdL<00>Z?dMdN<00>Z@dOdP<00>ZAdS)Rz<52>Testing extensions.
this module is designed to work as a testing-framework-agnostic library,
so that we can continue to support nose and also begin adding new
functionality via py.test.
<EFBFBD>)<01>absolute_importN<74>c
Cs|ddddddtdd<00>|ddddddtdd <00>|d
dd ddd d dd<00>|ddddtdd<00>|ddd ddd ddd<00>|dddd ddd<00>|dddd ddd<00>|dddd ddd<00>|dddd ddd <00>|d!ddd d"d#d$dd%<00>|d&dddddtdd'<00>|d(ddd d)d#d$dd*<00>|d+dddtdddd,<00>|d-dddtdddd.<00>|d/ddd d0d#d$dd1<00>|d2ddd d3d#d$dd4<00>dS)5Nz
--log-info<66>action<6F>callback<63>type<70>string<6E>helpz,turn on info logging for <LOG> (multiple OK)z --log-debugz-turn on debug logging for <LOG> (multiple OK)z--db<64>append<6E>dest<73>dbzBUse prefab database uri. Multiple OK, first one is run by default.z--dbszList available prefab dbsz--dburi<72>dburiz8Database uri. Multiple OK, first one is run by default.z --dropfirst<73>
store_true<EFBFBD> dropfirstz,Drop all tables in the target database firstz--backend-only<6C> backend_onlyz&Run only tests marked with __backend__z--low-connections<6E>low_connectionsz>Use a low number of distinct connections - i.e. for Oracle TNSz--write-identsZ write_identszCwrite out generated follower idents to <file>, when -n<num> is usedz --reversetop<6F>
reversetop<EFBFBD>defaultFzTUse a random-ordering set implementation in the ORM (helps reveal dependency issues)z--requirementsz3requirements class for testing, overrides setup.cfgz--with-cdecimal<61>cdecimalzDMonkeypatch the cdecimal library into Python 'decimal' for all testsz --include-tagzInclude tests with tag <tag>z --exclude-tagzExclude tests with tag <tag>z--write-profilesZwrite_profilesz$Write/update failing profiling data.z--force-write-profilesZforce_write_profilesz,Unconditionally write/update profiling data.)<05>_log<6F> _list_dbs<62>_requirements_opt<70> _include_tag<61> _exclude_tag)<01> make_option<6F>r<00>K/tmp/pip-build-zkr322cu/sqlalchemy/sqlalchemy/testing/plugin/plugin_base.py<70> setup_options0sR     rcCsddlm}||_dS)z<>Configure required state for a follower.
This invokes in the parent process and typically includes
database creation.
r)<01> provisionN)<03>sqlalchemy.testingr<00>FOLLOWER_IDENT)Zfollower_identrrrr<00>configure_followerbsr cCsitd6td6|d<dS)aTStore important configuration we will need to send to a follower.
This invokes in the parent process after normal config is set up.
This is necessary as py.test seems to not be using forking, so we
start with nothing in memory, *but* it isn't running our argparse
callables, so we have to just copy all of that over.
<20> include_tags<67> exclude_tags<67>memoized_configN)r!r")<01>dict_rrr<00>!memoize_important_follower_configms
r%cCs.tj|dd<19>tj|dd<19>dS)zfRestore important configuration needed by a follower.
This invokes in the follower process.
r#r!r"N)r!<00>updater")r$rrr<00>!restore_important_follower_config}sr'cCs#tj<00>atjddg<00>dS)Nz setup.cfgztest.cfg)<04> configparser<65> ConfigParser<65> file_config<69>readrrrr<00> read_config<69>s r,cCs(|axtD]}|tt<00>q WdS)z7things to set up early, before coverage might be setup.N)<03>options<6E> pre_configurer*)<02>opt<70>fnrrr<00> pre_begin<69>s r1cCs |t_dS)N)r-Z has_coverage)<01>valuerrr<00>set_coverage_flag<61>sr3cCs
|adS)N)<01>_skip_test_exception)<01>excrrr<00> set_skip_test<73>sr6cCs<>xtD]}|tt<00>qWddlmaddlmamamaddlm a m
a
m a ddlm a ddlm a t
j<00>dS)z9things to set up later, once we know coverage is running.r)<01>testing)<03>fixtures<65>engines<65>
exclusions)<03>
assertions<EFBFBD>warnings<67> profiling)<01>config)<01>utilN)<0F>post_configurer-r*<00>
sqlalchemyr7rr8r9r:r;r<r=r>r?Z setup_filters)r0rrr<00>
post_begin<EFBFBD>s rBcCsytsddlatj<00>n|jd<00>rJtj|<00>jtj<00>n+|jd<00>rutj|<00>jtj<00>ndS)Nrz-infoz-debug)<07>logging<6E> basicConfig<69>endswith<74> getLogger<65>setLevel<65>INFO<46>DEBUG)<03>opt_strr2<00>parserrrrr<00>s  rcGs[td<00>x=ttjd<00><00>D]&}td|tjd|<00>f<16>q Wtjd<00>dS)Nz0Available --db options (use --dburi to override)r z%20s %sr)<07>print<6E>sortedr*r-<00>get<65>sys<79>exit)<02>argsZmacrorrrr<00>s
$rcCst|<00>dS)N)<01>_setup_requirements)rJr2rKrrrr<00>srcCstj|jdd<00><00>dS)N<>-<2D>_)r"<00>add<64>replace)rJr2rKrrrr<00>srcCstj|jdd<00><00>dS)NrSrT)r!rUrV)rJr2rKrrrr<00>srcCstj|<00>|S)N)r.r )r0rrr<00>pre<72>s rWcCstj|<00>|S)N)r@r )r0rrr<00>post<73>s rXcCs
|adS)N)r-)r/r*rrr<00>_setup_options<6E>srYcCs)|jr%ddl}|tjd<ndS)Nr<00>decimal)rrO<00>modules)r-r*rrrr<00>_monkeypatch_cdecimal<61>s  r\cCsddlm}t|_dS)Nr)r>)rr>r4)r-r*r>rrr<00>_init_skiptest<73>sr]c
Cs=ddlm}ddlm}ddlm}|jrKt|j<00>}ng}|jr<>xr|jD]d}x[tj d|<00>D]G}||j
d<00>kr<>t d|<16><00>q}|j |j d|<00><00>q}WqdWn|s<>|j |j dd<00><00>nxE|D]=}|j||||j<00>} |js<>| j| |<00>q<>q<>WdS) Nr)r>)r7)rz[,\s]+r z:Unknown URI specifier '%s'. Specify --dbs for known uris.r)rr>rAr7rr <00>listr <00>re<72>splitr-<00> RuntimeErrorr rNZ setup_configr<00>_currentZset_as_current)
r-r*r>r7rZdb_urlsZdb_tokenr Zdb_url<72>cfgrrr<00> _engine_uri<72>s*   $  rdcCs |jdd<00>}t|<00>dS)N<> sqla_testing<6E>requirement_cls)rNrR)r-r*rfrrr<00> _requirementssrgcCs<>ddlm}ddlm}|jdk r3dS|jd<00>\}}t|<00>}x0|jd<00>dd<00>D]}t||<00>}qnWt||<00>}|<00>|_|_dS)Nr)r>)r7<00>:<3A>.<2E>) rr>rAr7<00> requirementsr`<00>
__import__<EFBFBD>getattr<74>requires)Zargumentr>r7<00>modnameZclsname<6D>mod<6F> componentZreq_clsrrrrRs  rRcCsddlm}m}ddlm}ddlm}m}|jrx<>|j j
<00>D]<5D>}|j }||<00>} y| j <00>}
Wnt k
r<>Yn:Xx6|
D].} |j|j|j| |j<00><00><00><00>q<>W|jjj|<00>rPy| j dd<00>}
Wnt k
r YqPXx?|
D]4} |j|j|j| |j<00>dd<00><01><00>qWn|j|| <00>|jjj|<00>r<>|j|| d|j<00>n||d<00>rUddlm} xJ| jd <00>D]6} |j| j| jd
| d
d| d<19><02><00>q<>WqUqUWndS) Nr)r>r?)<01>against)<02>schema<6D>inspectrs<00> test_schema<6D>
postgresql)rv<00>*<2A>name)rr>r?Zsqlalchemy.testing.exclusionsrrrArsrtr<00>Config<69> all_configsr Zget_view_names<65>NotImplementedError<6F>executeZ _DropViewZTableZMetaDatarkZschemas<61>enabled_for_configZdrop_all_tablesruZsqlalchemy.dialectsrvZ get_enumsZ DropEnumTypeZENUM)r-r*r>r?rrrsrtrc<00>eZ inspectorZ
view_namesZvnamerv<00>enumrrr<00>_prep_testing_database/sD              
r<>cCs'|jr#ddlm}|<00>ndS)Nr)<01>randomize_unitofwork)rZsqlalchemy.orm.utilr<6C>)r-r*r<>rrr<00>_reverse_topological^s r<>cCs&ddlm}t|_||_dS)Nr)r>)rr>r-r*)r/r*r>rrr<00>_post_setup_optionses r<>cCs2ddlm}|j|jdd<00><00>|_dS)Nr)r=reZ profile_file)rr=ZProfileStatsFilerNZ_profile_stats)r-r*r=rrr<00>_setup_profilinglsr<>cCsWt|tj<00>sdS|jjd<00>r,dStjjrOt|dd<00> rOdSdSdS)NFrT<00> __backend__T) <09>
issubclassr8ZTestBase<73>__name__<5F>
startswithr>r-rrm)<01>clsrrr<00>
want_classss
r<>cCs<>|jjd<00>sdS|jdkr)dStr~t|d<00>r\tj|j<00>jtt <00>p}t|d<00>o}|j
jtt <00>St r<>t|d<00>r<>tj|j<00>jtt <00>St r<>t|d<00>r<>|j
jtt <00>SdSdS)NZtest_F<5F>__tags__<5F>_sa_exclusion_extendT) r<>r<><00>
__module__r!<00>hasattrr:<00>tagsr<73>Z include_testr"r<>)r<>r0rrr<00> want_methods"  

r<>ccs<>t|dd<00>r<>x<>t|<00>D]o}d|j|jj|jjf}t||fid|jj|jjfd6<>}t|||<00>|VqWn|VdS)Nr<4E>Fz%s_%s_%sz%s+%s<> __only_on__)rm<00>_possible_configs_for_clsr<73>r rx<00>driverr<00>setattr)r<><00>modulercrx<00>subclsrrr<00>generate_sub_tests<74>s"# r<>cCst|<00>t|<00>dS)N)<02> _do_skips<70> _setup_engine)r<>rrr<00>start_test_class<73>s
r<>c
Cs6tjj<00>ztjs&tj<00>nWdt<00>XdS)N)r9<00>testing_reaperZ_stop_test_ctxr-rr;Zglobal_cleanup_assertions<6E>_restore_engine)r<>rrr<00>stop_test_class<73>s
  r<>cCstjjt<00>dS)N)r>rb<00>resetr7rrrrr<><00>sr<>cCsAt|dd<00>r=tjd|j<00>}tjj|t<00>ndS)N<>__engine_options__r-)rmr9Ztesting_enginer<65>r>rbZ push_enginer7)r<>Zengrrrr<><00>sr<>cCsn|j}dtjjtjjf}|j|<00>rN|dt|<00> <0B>}nd|||f}|t_dS)Nz_%s_%srz%s.%s.%s) r<>r>r rxr<>rE<00>lenr=Z _current_test)<07>testZtest_module_nameZ
test_classZ test_namerx<00>suffixZid_rrr<00> before_test<73>s  r<>cCstjj<00>dS)N)r9r<>Z_after_test_ctx)r<>rrr<00>
after_test<EFBFBD>sr<>c
Csttjj<00><00>}|jrftj|j<00>}x3t|<00>D]"}||<00>r=|j|<00>q=q=Wnt |dd<00>r<>tjt
j |j <00><00>}x3t|<00>D]"}||<00>s<>|j|<00>q<>q<>Wnt |d<00>r`tj}x|t|<00>D]k}xb|jD]W}t ||<00>}|j|<00>}|r<>|j|<00>|dk rQ|j|<00>nPq<50>q<>Wq<57>Wnt |d<00>r<>t<00>} tj}xVt|<00>D]H}x?|jD]4}t ||<00>}|j|<00>s<>| j|<00>q<>q<>Wq<57>W|j| <00>r<>|j| <00>q<>n|S)Nr<4E><00> __requires__<5F>__prefer_requires__)<17>setr>ryrzZ__unsupported_on__r:<00>db_specr^<00>removermr?<00>to_listr<74>r<>rkr<>Zmatching_config_reasons<6E>extendr<64>r}rU<00>
difference<EFBFBD>difference_update)
r<EFBFBD><00>reasonsrz<00>spec<65>
config_objrk<00> requirement<6E>checkZ skip_reasons<6E> non_preferredrrrr<><00>sB        r<>cCs<>g}t||<00>}t|dd<00>rmxCt|d<00>D]/}|<00>r7tjd|j|jf<16>q7q7Wn|s<>t|dd<00>r<>d|j|jf}n>d|jdjdd <00>tjj<00>D<><00>dj|<00>f}tj|<00>n<>t |d
<00>rnt
<00>}t j t j|j<00><00>}x*|D]"}||<00>s&|j|<00>q&q&W|j|<00>rn|j|<00>qnntj|kr<>t|j<00>|<00>ndS) NZ __skip_if__Fz'%s' skipped by %sr<73>z('%s' unsupported for implementation '%s'z.'%s' unsupported on any DB implementation %s%sz, cssM|]C}d|jjdjdd<00>|jjjD<><00>|jjfVqdS)z '%s(%s)+%s'ricss|]}t|<00>VqdS)N)<01>str)<02>.0<EFBFBD>digrrr<00> <genexpr>sz&_do_skips.<locals>.<genexpr>.<genexpr>N)r rx<00>join<69>dialectZserver_version_infor<6F>)r<>r<>rrrr<>sz_do_skips.<locals>.<genexpr><3E>__prefer_backends__)r<>rmr>Z skip_testr<74>r<>r<>ryrzr<>r<>r:r<>r?r<>r<>rUr<>r<>rb<00> _setup_config<69>pop)r<>r<>rz<00>c<>msgr<67>r<>r<>rrrr<>s8      r<>cCstjj|t<00>dS)N)r>rb<00>pushr7)r<><00>ctxrrrr<>,sr<>)rr)B<>__doc__<5F>
__future__rrOr_<00> version_infoZpy3kr(r)r8r9r:r<r=r;rkr>r7r?r*rCr<>r!r"r-rr r%r'r,r1r3r4r6rBrrrrrr.r@rWrXrYr\r]rdrgrRr<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rrrr<00><module>s~      2            ! /       + ,