Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/testing/plugin/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/testing/plugin/__pycache__/pytestplugin.cpython-311.pyc

�

�܋f�>���	ddlZn#e$r	ddlmZYnwxYwddlZddlZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZ	ddlZejrddlmZn#e$rYnwxYw	ddlZdZn
#e$rdZYnwxYwd�Zd	�Zd
�Zd�Zer
ddlZd�Zd
�Zd�Zd�Zdad�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&Gd�dej'��Z(dS)�N�)�plugin_base)�update_wrapper)�SequenceTFc���|�d����fd�}tj|��tj��dS)N�
sqlalchemyc������|�dd����rG�fd�dtj����|d<|�dd����r G��fd�dtj����|d<�j|fi|��dS)N�callbackc���eZdZ	d�fd�	ZdS)�=pytest_addoption.<locals>.make_option.<locals>.CallableActionNc�"���|||��dS�N�)�self�parser�	namespace�values�
option_string�	callback_s     ��y/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/sqlalchemy/testing/plugin/pytestplugin.py�__call__zFpytest_addoption.<locals>.make_option.<locals>.CallableAction.__call__,s����I�m�V�V�<�<�<�<�<�r)�__name__�
__module__�__qualname__r)rs�r�CallableActionr+s6�������CG�=�=�=�=�=�=�=�=rr�action�zeroarg_callbackc�8���eZdZ			d��fd�	Z	d�fd�	Z�xZS)rFNc	�\��t�|���||dd|||���dS)NrT)�option_strings�dest�nargs�const�default�required�help)�super�__init__)rr!r"r%r&r'r�	__class__s      ��rr)zFpytest_addoption.<locals>.make_option.<locals>.CallableAction.__init__7sK����.�$�/�/�8�8�'5�!��"� '�!)�!�9�����rc�"���|||��dSrr)rrrrrrs     �rrzFpytest_addoption.<locals>.make_option.<locals>.CallableAction.__call__Is ���%�$�]�F�F�C�C�C�C�Cr)FFNr)rrrr)r�
__classcell__)r*rrs@��rrz=pytest_addoption.<locals>.make_option.<locals>.CallableAction6s}��������
"�"��
�������&DH�D�D�D�D�D�D�D�D�D�Dr)�pop�argparse�Action�	addoption)�name�kwrrr�groups  @@@�r�make_optionz%pytest_addoption.<locals>.make_option's��������F�F�:�t�,�,�	��	*�
=�
=�
=�
=�
=�
=�
=���
=�
=�
=�*�B�x�L��6�6�"4�d�;�;���	*�
D�
D�
D�
D�
D�
D�
D�
D���
D�
D�
D�0*�B�x�L�����#�#��#�#�#�#�#r)�getgroupr�
setup_options�read_config)rr4r3s  @r�pytest_addoptionr8$sV����O�O�L�)�)�E�)$�)$�)$�)$�)$�V��k�*�*�*�������rc	�4�tjd��t|d��r9tj|j��tj|jd��nS|jjrGtj
�|jj��rtj|jj��tj
|j��tjtt!|jdd������tjt$��dS)Nzsqlalchemy.testing.assertions�workerinput�follower_ident�
cov_sourceF)�pytest�register_assert_rewrite�hasattrr�!restore_important_follower_configr:�configure_follower�option�write_idents�os�path�exists�remove�	pre_begin�set_coverage_flag�bool�getattr�set_fixture_functions�PytestFixtureFunctions)�configs r�pytest_configurerOVs���
�"�#B�C�C�C��v�}�%�%�2��5�f�6H�I�I�I��&�v�'9�:J�'K�L�L�L�L��=�%�	2�"�'�.�.��M�&�+
�+
�	2�
�I�f�m�0�1�1�1���&�-�(�(�(��!��W�V�]�L�%�
8�
8�9�9�����%�&<�=�=�=�=�=rc�,�tj��dSr)r�
post_begin��sessions r�pytest_sessionstartrTks��������rc�,�tj��dSr)r�final_process_cleanuprRs r�pytest_sessionfinishrWos���%�'�'�'�'�'rc���tj|j��dtj��jdd�z|jd<ddlm}|�|jd��dS)Nztest_%sr�r;��	provision)	r�!memoize_important_follower_configr:�uuid�uuid4�hex�sqlalchemy.testingr[�create_follower_db)�noder[s  r�pytest_configure_nodercvsr��	�5�d�6F�G�G�G�-6�����9I�!�B�$�9O�-O���)�*�0�0�0�0�0�0��$�$�T�%5�6F�%G�H�H�H�H�Hrc�R�ddlm}|�|jd��dS)NrrZr;)r`r[�drop_follower_dbr:)rb�errorr[s   r�pytest_testnodedownrg�s7��0�0�0�0�0�0��"�"�4�#3�4D�#E�F�F�F�F�Frc��tjd���}d�|D��|dd�<td�|D����}|D]�}tj|j|jj��D]�}||jur�||j}ttj
dtj
��}||j|jj������D]9}	|	���D]"}
||
j
�|
���#�:����g}|D]V}|jj|vr1|�||jj|j
���A|�|���Wt!|d����|dd�<dS)Nc�4�tjt��Sr)�collections�defaultdict�listrrr�<lambda>z/pytest_collection_modifyitems.<locals>.<lambda>�s���'��-�-�rc��g|]G}t|jtj���!|jjj�d���E|��HS)�_)�
isinstance�parentr=�Instancer1�
startswith��.0�items  r�
<listcomp>z1pytest_collection_modifyitems.<locals>.<listcomp>�s\�������d�k�6�?�3�3����"�'�2�2�3�7�7�	����rc3�$K�|]}|jV��dSr)rqrts  r�	<genexpr>z0pytest_collection_modifyitems.<locals>.<genexpr>�s$����5�5�t�t�{�5�5�5�5�5�5r�from_parent�r1rqc�\�|jjjj|jjj|jfSr)rqr1�rvs rrmz/pytest_collection_modifyitems.<locals>.<lambda>�s'���K��%�*��K��#��I�
�r)�key)rjrk�setr�generate_sub_tests�clsrq�modulerKr=�Classr�collectr1�append�extend�sorted)
rSrN�items�
rebuilt_items�test_classes�
test_class�sub_cls�per_cls_dict�ctor�inst�t�newitemsrvs
             r�pytest_collection_modifyitemsr��s��� �+�-�-���M�������E�!�!�!�H��5�5�u�5�5�5�5�5�L�"�
7�
7�
�"�5��N�J�-�4�
�
�	7�	7�G��j�n�,�,�,�Z�^�<���v�|�]�F�L�I�I�� �D� �)�*�2C�2J�����'�)�)�7�7�D�"�\�\�^�^�7�7��$�Q�V�,�3�3�A�6�6�6�6�7��	7��H��"�"���;�?�m�+�+��O�O�M�$�+�/�:�4�9�E�F�F�F�F��O�O�D�!�!�!�!���
�
����E�!�!�!�H�H�Hrc�~���tj|��r\tj||��rGt	t
jdt
j�����fd�t�j|��D��Stj	|��r6t�t
j��rtj�j
|��rdSgS)Nrzc�4��g|]}�|j������S)r{)r)ru�parametrize_cls�	collectorr�s  ��rrwz-pytest_pycollect_makeitem.<locals>.<listcomp>�s;���
�
�
��
�D�o�.�y�A�A�A�
�
�
r)�inspect�isclassr�
want_classrKr=r��_parametrize_clsr��
isfunctionrprr�want_methodr�)r�r1�objr�s`  @r�pytest_pycollect_makeitemr��s�������s����� 6�t�S� A� A���v�|�]�F�L�A�A��
�
�
�
�
�#3�I�4D�c�#J�#J�
�
�
�	
�
	��3���
��y�&�/�2�2�
�
�#�I�M�3�7�7�
��t��	rc��d|jvr|gS|j}g}tjd�|D���D]�}i}t	d�|D��|��D]K\}}|std���t
jd|��}t	||j��D]
\}	}
|
||	<��Ld�	d�|D����}|j
�d|��}t�t||f|��}
t|||
��|�|
����|S)z6implement a class-based version of pytest parametrize.�_sa_parametrizec��g|]\}}|��Srr)ru�argname�paramss   rrwz$_parametrize_cls.<locals>.<listcomp>�s��	8�	8�	8�_�W�f�&�	8�	8�	8rc��g|]
}|d��S)rr)ru�	_sa_params  rrwz$_parametrize_cls.<locals>.<listcomp>�s��;�;�;�i�Y�q�\�;�;�;rz*need argnames for class-based combinationsz,\s*roc	3�K�|]D}|j�d��D]'}ttjdd|����V��(�EdS)�-z\W�N)�id�split�str�re�sub)ru�param�tokens   rryz#_parametrize_cls.<locals>.<genexpr>�ss����%
�%
�������,�,�%
�%
�
�
���u�b�%�(�(�)�)�%
�%
�%
�%
�%
�%
�%
r)�__dict__r��	itertools�product�zip�	TypeErrorr�r�r�joinr�type�__new__�setattrr�)r�r�r��classes�full_param_set�
cls_variablesr�r��
argname_split�arg�val�parametrized_namer1�newclss              rr�r��sm�����,�,��u���)�O��G�#�+�	8�	8��	8�	8�	8������
�!�;�;�?�;�;�;�^�
�
�	)�	)�N�G�U��
N�� L�M�M�M��H�W�g�6�6�M��
�u�|�<�<�
)�
)���S�%(�
�c�"�"�
)��H�H�%
�%
�(�	%
�%
�%
�
�
���,�,�,�(9�(9�:�����d�D�3�&�-�@�@�����f�%�%�%����v������Nrc���t�tj��sdSt�It	�jj���jja�fd�}�jj�|��t���dS)Nc�>��t�jj��dadSr)�class_teardownrq�_current_classr}s�r�finalizez&pytest_runtest_setup.<locals>.finalizes����4�;�-�.�.�.�!�N�N�Nr)rpr=�Functionr��class_setuprq�addfinalizer�
test_setup)rvr�s` r�pytest_runtest_setupr��s�����d�F�O�,�,�������D�K�&�'�'�'���+��
	"�	"�	"�	"�	"�
	
���'�'��1�1�1��t�����rc�$�t|��dSr)�
test_teardownr}s r�pytest_runtest_teardownr�s��
�$�����rc�p�tj||jjj|jj|j��dSr)r�before_testrqr�rr�r1r}s rr�r�!s8�����d�k� �)�4�;�?�D�I�����rc�.�tj|��dSr)r�
after_testr}s rr�r�'s����4� � � � � rc�8�tj|j��dSr)r�start_test_classr�r}s rr�r�+s��� ���*�*�*�*�*rc�8�tj|j��dSr)r�stop_test_classr�r}s rr�r�/s������)�)�)�)�)rc�|�tjjdkrtj|��Stj|��S)N�)�sys�version_info�majorr��getfullargspec�
getargspec)�fns rr�r�3s5��
����"�"��%�b�)�)�)��!�"�%�%�%rc�>�����ddlm�ddlm�d��d����fd�	}|S)z:Port of langhelpers.decorator with pytest-specific tricks.r)�format_argspec_plus)�inspect_getfullargspecc�2�t||��||Sr)�exec)�code�env�fn_names   r�_exec_code_in_envz/_pytest_fn_decorator.<locals>._exec_code_in_env@s���T�3�����7�|�rrc����|��}|r|j�|��tdd|j���}|��|d�����d|z}�|�	|d�|j��}|s2t|d|��j|_||_t||��S|j	|_	|j|_|S)	N�targetr�)r�r�r1F)�groupedzDdef %(name)s(%(args)s):
    return %(target)s(%(fn)s, %(apply_kw)s)
)r�r��im_func)
�argsr��dictr�updaterK�__defaults__�__wrapped__rr)
r��add_positional_parameters�spec�metadatar��	decoratedr�r�r�r�s
      ����r�decoratez&_pytest_fn_decorator.<locals>.decorateDs����%�%�b�)�)��$�	8��I���6�7�7�7��x�D�r�{�C�C�C�����+�+�D�%�@�@�@�A�A�A�
��	
�	
�&�%��V�2�.�.���
�
�	�)�
	�%,�R��B�%?�%?�%L�I�"�$&�I�!�!�)�R�0�0�0�
$&�=�I� �!#��I���r)r)�sqlalchemy.util.langhelpersr��sqlalchemy.util.compatr�)r�r�r�r�r�s` @@@r�_pytest_fn_decoratorr�:sp������@�?�?�?�?�?�=�=�=�=�=�=�������������<�Orc�>�eZdZd�Zd�eed�d�Zd�Zd�Zd�Z	d�Z
d	S)
rMc�.�tjj|i|��Sr)r=�skip�	Exception�rr�r2s   r�skip_test_exceptionz*PytestFixtureFunctions.skip_test_exceptionfs���{�$�c�0�R�0�0�0rc��|Srr�r�s rrmzPytestFixtureFunctions.<lambda>js���rc�X�t|d��r|jnt|��jS)Nr)r?rr�r�s rrmzPytestFixtureFunctions.<lambda>ms+���3�
�#�#� ����
�#�Y�Y�
�r)�i�r�s�nc	�J�
������ddlm�tjjdkr?t|��dkr+t
|dd��rt|d��}n>t|��dkr+t
|dd��rt|d��}|�dd����fd	�}|�d
d��}g}d�|r�|j	�
tjdgd�t|��D���R�}�
fd
�t|��D��}|D]v�t�t��s�f�|���\}}	||��dd�}
|	rd�|�|
|	d��fd�|D����f���wnG|D]D�t�t��s�f�|���\}}	|	rd�|�||	df���Eg�|D]4\}
}	}�r|
|	fz
}
t#j|
d|i�}��|���5����fd�}|S)aFacade for pytest.mark.parametrize.

        Automatically derives argument names from the callable which in our
        case is always a method on a class with positional arguments.

        ids for parameter sets are derived using an optional template.

        r)�
exclusionsr�r�__next__�next�argnamesNc���g}g}|D]B}t|�j��r|�|���-|�|���C||fSr)rp�compoundr�)r��result�gathered_exclusions�ars    �r�_filter_exclusionsz?PytestFixtureFunctions.combinations.<locals>._filter_exclusions�sj����F�"$���
%�
%���a��!4�5�5�%�'�.�.�q�1�1�1�1��M�M�!�$�$�$�$��.�.�.r�id_Fc� �g|]\}}|dv�	|��S))rrrrr)ru�idx�chars   rrwz7PytestFixtureFunctions.combinations.<locals>.<listcomp>�s2�����!��T��3�3�3��3�3�3rc�V��g|]%\}}|�v�	tj|���|f��&Sr)�operator�
itemgetter)rurr�_combination_id_fnss   �rrwz7PytestFixtureFunctions.combinations.<locals>.<listcomp>�sI�������C���.�.�.��$�S�)�)�+>�t�+D�E�.�.�.rTr�c3�F�K�|]\}}||�����V��dSrr)ru�getter�comb_fnr�s   �rryz6PytestFixtureFunctions.combinations.<locals>.<genexpr>�sJ�����!�!�5D�V�W�G�G�F�F�3�K�K�0�0�!�!�!�!�!�!rr�c���tj|��r?�rtd���d|jvrg|_|j���f��|S��t
|��jdd�}ntj	d���}�r(|dgz
}t�fd���}d�}||d�	��}tj�
|���|��S)
Nz5exclusions not supported for class level combinationsr�rz, *�_exclusionsc���|d}|r'����j|�}||��}||dd�i|��S)N���r)r�add)r�r�r2r�exlurs     �r�check_exclusionszOPytestFixtureFunctions.combinations.<locals>.decorate.<locals>.check_exclusions�sY���&*�2�h��&�*�#<�:�#6�#6�#8�#8�#<�k�#J�D�!%��b���B�!�r�4��"��:�4��4�4�4rc�:�|j�d��dS)Nr)r�r�)r�s r�process_metadatazOPytestFixtureFunctions.combinations.<locals>.decorate.<locals>.process_metadata�s���	�(�(��7�7�7�7�7r)r)r�)r�r��NotImplementedErrorr�r�r�r�r�r�r�r�r=�mark�parametrize)r��	_argnamesr!r#r	r�has_exclusions�
pytest_paramss    ����rr�z5PytestFixtureFunctions.combinations.<locals>.decorate�s*�����r�"�"�#
M�!��-�O����%�B�K�7�7�)+�B�&��"�)�)�8�]�*C�D�D�D��	��#� *�2��� 3�A�B�B� 7�I�I� "����!�!�I�"���-��0�I�)�5�5�5�5�*�)�5�8�8�8�*�)��6F����B��{�.�.�y�-�H�H��L�L�Lr)r`rr�r�r��lenr?rlr-rrr�	enumeraterp�tupler�r�r=r�)r�arg_setsr2rr�tobuild_pytest_params�_arg_getter�fns�	fn_params�param_exclusions�
parametersr�r�rr�r	rr(r)s             @@@@@@r�combinationsz#PytestFixtureFunctions.combinationsrs;��������	2�1�1�1�1�1���!�Q�&�&��8�}�}��!�!�g�h�q�k�:�&F�&F�!�����,�,����8�}�}��!�!�g�h�q�k�6�&B�&B�!�����,�,���6�6�*�d�+�+��		/�		/�		/�		/�		/��f�f�U�D�!�!�� "�����6	�"&�":��
#�-�����%.�s�^�^�������K�����!*�3������C� �
�
��!�#�u�-�-�!��&�C�.@�.@��.E�.E�+�	�+�(�[��3�3�A�B�B�7�
�#�*�%)�N�%�,�,�"�(����!�!�!�!�HK�!�!�!��������
�. �
�
��!�#�u�-�-�!��&�C�.@�.@��.E�.E�+�	�+�#�*�%)�N�%�,�,�� 0�$�7������
�1F�	(�	(�-�J�(�#��
2��/�1�1�
��L�*�5��5�5�E�� � ��'�'�'�'�$	M�$	M�$	M�$	M�$	M�$	M�$	M�$	M�L�rc�D�|d}tj|dd�d|i�S)Nrrr�)r=r�)rr3�idents   r�param_identz"PytestFixtureFunctions.param_ident�s(���1�
���|�Z����^�6��6�6�6rc�$�tj|i|��Sr)r=�fixturer�s   rr9zPytestFixtureFunctions.fixtures���~�s�)�b�)�)�)rc�@�tj�d��S)N�PYTEST_CURRENT_TEST)rD�environ�get)rs r�get_current_test_namez,PytestFixtureFunctions.get_current_test_names���z�~�~�3�4�4�4rN)rrrr��reprr�rr4r7r9r>rrrrMrMes�������1�1�1��_�
�
� � �	���I�I�I�V7�7�7�*�*�*�5�5�5�5�5rrM))�sqla_plugin_baser�ImportErrorr�r.rj�	functoolsrr�r�rrDr�r�r=�typing�
TYPE_CHECKINGr�xdist�	has_xdistr8rOrTrWr]rcrgr�r�r�r�r�r�r�r�r�r�r�r��FixtureFunctionsrMrrr�<module>rHs����*�*�*�*�*��������������������������$�$�$�$�$�$�������������	�	�	�	�	�	�	�	�
�
�
�
�
�
�
�
�$��M�M�M���$�#�#�#�#�#�#���	�	�	�	��D�	������L�L�L��I�I�������I�I�I�����/�/�/�d>�>�>�*���(�(�(�
�G��K�K�K�	I�	I�	I�G�G�G�6�6�6�r���0�� � � �F���6������!�!�!�+�+�+�*�*�*�&�&�&�(�(�(�V`5�`5�`5�`5�`5�[�9�`5�`5�`5�`5�`5s0����A�A�A�!A(�(A2�1A2

Hacked By AnonymousFox1.0, Coded By AnonymousFox