Hacked By AnonymousFox

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

�

�܋f
��b�ddlmZddlZddlmZddlmZddlmZd�Z	d�Z
dd
�Zdd�Zdd�Z
dS)�)�annotationsN)�Union)�inspect_getfullargspec�)�sqla_2c���ddlm}t���|D]}��|���t	����|j�fd�|D��ddt
���zzd����d��S)aA facade around @testing.combinations() oriented towards boolean
    keyword-based arguments.

    Basically generates a nice looking identifier based on the keywords
    and also sets up the argument names.

    E.g.::

        @testing.flag_combinations(
            dict(lazy=False, passive=False),
            dict(lazy=True, passive=False),
            dict(lazy=False, passive=True),
            dict(lazy=False, passive=True, raiseload=True),
        )


    would result in::

        @testing.combinations(
            ('', False, False, False),
            ('lazy', True, False, False),
            ('lazy_passive', True, True, False),
            ('lazy_passive', True, True, True),
            id_='iaaa',
            argnames='lazy,passive,raiseload'
        )

    r��configc����g|]@�d��fd��D����ft�fd��D����z��AS)�_c3�H�K�|]}��|d���|V��dS�FN��get��.0�k�ds  ��e/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/alembic/testing/util.py�	<genexpr>z/flag_combinations.<locals>.<listcomp>.<genexpr>9s4�����9�9�A����q�%���9�a�9�9�9�9�9�9�c3�D�K�|]}��|d��V��dSrrrs  �rrz/flag_combinations.<locals>.<listcomp>.<genexpr>:s/�����2�2��A�E�E�!�U�O�O�2�2�2�2�2�2r)�join�tuple)rr�keyss @�r�
<listcomp>z%flag_combinations.<locals>.<listcomp>8su����

�

�

���X�X�9�9�9�9��9�9�9�
9�
9�;��2�2�2�2�T�2�2�2�2�2�
3�

�

�

r�i�a�,)�id_�argnames)�sqlalchemy.testingr
�set�update�sorted�combinations�lenr)r&r
rrs   @r�flag_combinationsr(s����:*�)�)�)�)�)��5�5�D�
�������A������$�<�<�D��6��

�

�

�

�"�

�

�

�

�3��T���?�#����$������rc����t|��d}�fd�|D��}t|j��}|����t	j|j|��}|di|��S)z�Given a no-arg lambda and a namespace, return a new lambda that
    has all the values filled in.

    This is used so that we can have module-level fixtures that
    refer to instance-level variables using lambdas.

    rc�<��i|]}|��|����S�)�pop)r�arg�kws  �r�
<dictcomp>z"resolve_lambda.<locals>.<dictcomp>Ls%���:�:�:�#�S�"�&�&��+�+�:�:�:rr+)r�dict�__globals__r$�types�FunctionType�__code__)�__fnr.�pos_args�
pass_pos_args�glb�new_fns `    r�resolve_lambdar:Bsy���&�d�+�+�A�.�H�:�:�:�:��:�:�:�M�
�t��
 �
 �C��J�J�r�N�N�N�
�
��
�s�
3�
3�F��6�"�"�M�"�"�"r�functionc�2����ddlm�ddlm����fd�}|S)z&Provide MetaData for a pytest fixture.rr	�)�fixture_functionsc�P�����fd�}������|��S)Nc3��K�ddlm}|���x}|_	�||��}|��j��|V�|��j��dS#|��j��wxYw)Nr)�schema)�
sqlalchemyrA�MetaData�metadata�
create_all�db�drop_all)�selfrArD�resultr
�fns    ��r�run_ddlz3metadata_fixture.<locals>.decorate.<locals>.run_ddlZs������)�)�)�)�)�)�'-���'8�'8�8�H�t�}�
-���D�(�+�+���#�#�F�I�.�.�.������!�!�&�)�,�,�,�,�,���!�!�&�)�,�,�,�,���s�*A,�,B)�scope)�fixture)rJrKr
�ddlr>s` ���r�decoratez"metadata_fixture.<locals>.decorateYsF����	-�	-�	-�	-�	-�	-�4� �(�(�s�(�3�3�G�<�<�<r)r"r
�r>)rNrOr
r>s` @@r�metadata_fixturerQSsU�����*�)�)�)�)�)�#�#�#�#�#�#�=�=�=�=�=�=�=� �Or�value�str�return�Union[int, str]c�4�	t|��S#|cYSxYw)N)�int)rRs r�	_safe_intrXls%����5�z�z����������s��Fc��ddlm}ddlm}|st	|jjdd��}ts	|rd|ini}ni}|||fi|��S)Nrr	)�testing_engine�
future_engineF�future)r"r
�sqlalchemy.testing.enginesrZ�getattr�_current�optionsr)�urlr`r\r
rZr.s      rrZrZss���)�)�)�)�)�)�9�9�9�9�9�9��J����0�/�5�I�I����#)�
1�h��
�
�r���
���>�#�w�-�-�"�-�-�-r)r;)rRrSrTrU)NNF)�
__future__rr2�typingr�sqlalchemy.utilr�utilrr(r:rQrXrZr+rr�<module>rfs���#�"�"�"�"�"�����������2�2�2�2�2�2�������.�.�.�b#�#�#�"����2����.�.�.�.�.�.r

Hacked By AnonymousFox1.0, Coded By AnonymousFox