U ÃÏ a`ã@sŒddlZddlmZdZdadadadZdada da da dZ dZ dd„Zdd „Zd d „Zd d „Zdd„ZGdd„deƒZdd„Zdd„ZdS)éNé)ÚutilFÚmaincOs tj||ŽS)aÿ Deliver multiple versions of a test based on positional combinations. This is a facade over pytest.mark.parametrize. :param \*comb: argument combinations. These are tuples that will be passed positionally to the decorated function. :param argnames: optional list of argument names. These are the names of the arguments in the test function that correspond to the entries in each argument tuple. pytest.mark.parametrize requires this, however the combinations function will derive it automatically if not present by using ``inspect.getfullargspec(fn).args[1:]``. Note this assumes the first argument is "self" which is discarded. :param id\_: optional id template. This is a string template that describes how the "id" for each parameter set should be defined, if any. The number of characters in the template should match the number of entries in each argument tuple. Each character describes how the corresponding entry in the argument tuple should be handled, as far as whether or not it is included in the arguments passed to the function, as well as if it is included in the tokens used to create the id of the parameter set. If omitted, the argument combinations are passed to parametrize as is. If passed, each argument combination is turned into a pytest.param() object, mapping the elements of the argument tuple to produce an id based on a character value in the same position within the string template using the following scheme:: i - the given argument is a string that is part of the id only, don't pass it as an argument n - the given argument should be passed and it should be added to the id by calling the .__name__ attribute r - the given argument should be passed and it should be added to the id by calling repr() s - the given argument should be passed and it should be added to the id by calling str() a - (argument) the given argument should be passed and it should not be used to generated the id e.g.:: @testing.combinations( (operator.eq, "eq"), (operator.ne, "ne"), (operator.gt, "gt"), (operator.lt, "lt"), id_="na" ) def test_operator(self, opfunc, name): pass The above combination will call ``.__name__`` on the first member of each tuple and use that as the "id" to pytest.param(). )Ú_fixture_functionsÚ combinations)ÚcombÚkw©r úZC:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-nyjtotrf\sqlalchemy\testing\config.pyrs?rcKs t||ŽS)z+As combination, but takes a single iterable)r)Z arg_iterablerr r r Úcombinations_list\sr cOs tj||ŽS©N)rÚfixture)Úargrr r r r asr cCst ¡Sr )rÚget_current_test_namer r r r resrcCst ¡Sr )rÚmark_base_test_classr r r r risrc@s’eZdZdd„Ze ¡ZeƒZdd„Z e dd„ƒZ e dd„ƒZ e d d „ƒZ e d d „ƒZe d d„ƒZe dd„ƒZe dd„ƒZe dd„ƒZdd„ZdS)ÚConfigcCsT| |¡||_||_||_||_d|_d|_|jjoLt   |j j   dd¡¡ |_dS)NÚ test_schemaÚ test_schema_2Zasync_fallbackF)Ú _set_nameÚdbÚdb_optsÚoptionsÚ file_configrrÚdialectÚis_asyncrZasboolÚurlÚqueryÚget)Úselfrrrrr r r Ú__init__ns  ÿzConfig.__init__cCsL|jjr6d dd„|jjDƒ¡}d|j|j|f|_nd|j|jf|_dS)NÚ.css|]}t|ƒVqdSr )Ústr)Ú.0Útokr r r Ú €sz#Config._set_name..z %s+%s_[%s]z%s+%s)rZserver_version_infoÚjoinÚnameZdriver)rrZsvir r r r~szConfig._set_namecCs(t||||ƒ}tp|ja|j |¡|S)z•add a config as one of the global configs. If there are no configs set up yet, this config also gets set as the "_current". )rÚ any_asyncrÚ_configsÚadd)ÚclsrrrrÚcfgr r r Úregister…s   zConfig.registercCs.|a|jja|ja|ja|ja|j|_adSr )Ú_currentrrÚdb_urlrrr©r*ÚconfigÚ namespacer r r Úset_as_current˜s zConfig.set_as_currentcCs,ts tdƒ‚| t|tjtjtjƒ|¡dS)Nz*Can't push without a default Config set up)r-ÚAssertionErrorÚpushrrrr)r*rr1r r r Ú push_engine¢s ÿüzConfig.push_enginecCs|j t¡| ||¡dSr )Ú_stackÚappendr-r2r/r r r r4¬s z Config.pushcCs(|jr$|jd}|jd=| ||¡dS)Néÿÿÿÿ)r6r2)r*r1r-r r r Úpop±s z Config.popcCs&|jr"| |jd|¡|j ¡dS)Nr)r6r2Úclear)r*r1r r r Úreset¹sz Config.resetcCs|jSr )r()r*r r r Ú all_configs¿szConfig.all_configsccs| ¡D] }|jVqdSr )r<r)r*r+r r r Úall_dbsÃs zConfig.all_dbscCs t|ƒdSr )Ú skip_test)rÚmsgr r r r>ÈszConfig.skip_testN)Ú__name__Ú __module__Ú __qualname__rÚ collectionsÚdequer6Úsetr(rÚ classmethodr,r2r5r4r9r;r<r=r>r r r r rms*         rcCst |¡‚dSr )rZskip_test_exception)r?r r r r>Ìsr>cCs t |¡Sr )rÚ async_test)Úfnr r r rGÐsrG)rCÚrÚ requirementsrr.rrrrr'r-Úidentrrr r rrÚobjectrr>rGr r r r Ús( B_