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__/assertions.cpython-311.pyc

�

�܋f���p�UddlmZddlZddlZddlZddlmZddlmZddlm	Z
ddlmZddl
mZddl
mZdd	l
mZdd
l
mZddl
mZddl
mZdd
l
mZddlmZddlmZd�Zd�Zd�Zd�Zd�Z	d&d�ZGd�d��Zej d&d���Z!d'd�Z"d'd�Z#d(d�Z$iZ%de&d <d!�Z'd"�Z(d#�Z)d$�Z*d%�Z+dS))�)�annotationsN)�Any)�Dict)�exc)�default)�_expect_warnings)�eq_)�is_)�is_false)�is_not_)�is_true)�ne_��	decorator�)�sqla_compatc�`�|j|jur|jsJd|�d|j�d����dSdS)aHassert that any exception we're catching does not have a __context__
    without a __cause__, and that __suppress_context__ is never set.

    Python 3 will report nested as exceptions as "during the handling of
    error X, error Y occurred". That's not what we want to do.  we want
    these exceptions in a cause chain.

    Fz
Exception z> was correctly raised but did not set a cause, within context z as its cause.N)�__context__�	__cause__�__suppress_context__)�	exceptions �k/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/alembic/testing/assertions.py� _assert_proper_exception_contextrs]��	��Y�%8�8�8��.�	9�	
�	
��y�y�)�/�/�/�
1�	
�	
�u�	9�8�8�8�c�*�t||||d���S)NT��
check_context��_assert_raises��
except_cls�	callable_�args�kws    r�
assert_raisesr%,s���*�i��r��N�N�N�Nrc�&�t||||��S�Nrr s    r�assert_raises_context_okr(0s���*�i��r�:�:�:rc�,�t|||||d���S)NT��msgrr�r!r+r"r#�kwargss     r�assert_raises_messager.4s&����I�t�V��D����rc�*�t|||||���S)N)r+rr,s     r� assert_raises_message_context_okr0:s���*�i��v�3�G�G�G�GrFc�r�t|||��5}||i|��ddd��n#1swxYwY|jSr')�_expect_raises�error)r!r"r#r-r+r�ecs       rrr@s���
�
�C��	7�	7�#�2��	�4�"�6�"�"�"�#�#�#�#�#�#�#�#�#�#�#����#�#�#�#�
�8�Os�	'�+�+c��eZdZUdZded<dS)�_ErrorContainerNrr3)�__name__�
__module__�__qualname__r3�__annotations__�rrr6r6Is#��������E������rr6c#�K�t��}|rtj��d}	|V�d}n�#|$r�}||_d}|�<t	j|t
|��tj��sJ|�d|�����|r|st|��tt
|���
d����Yd}~nd}~wwxYw|s
Jd���dS)NrFTz !~ zutf-8z#Callable did not raise an exception)r6�sys�exc_infor3�re�search�str�UNICODEr�print�encode)r!r+rr4�are_we_already_in_a_traceback�success�errs       rr2r2Ms����	�	�	�B��:�(+����q�(9�%�
(����������(�(�(�������?��9�S�#�c�(�(�B�J�7�7�J�J�C�9J�9J�S�9J�9J�J�J�7��	2�!>�	2�,�S�1�1�1�
�c�#�h�h�o�o�g�&�&�'�'�'�'�'�'�'�'�����(�����9�9�9�9�9�7�9�9s�4�C�B	C�CTc�$�t||���S)Nr�r2)r!rs  r�
expect_raisesrJbs���*�M�B�B�B�Brc�&�t|||���S)Nr*rI)r!r+rs   r�expect_raises_messagerLfs���*�#�]�K�K�K�Krc���tjdd|��}tjdd|��}tjdd|��}tjdd|��}||ksJ|p|�d|�����dS)Nz^\s+?|\n�z {2,}� z != )r?�sub)�a�br+s   r�eq_ignore_whitespacerSjsu��
��{�B��"�"�A�
��x��a� � �A�
��{�B��"�"�A�
��x��a� � �A���6�6�6�3�-����1�1�-�6�6�6�6�6rzDict[Any, Any]�
_dialect_modsc���|�|dkrtj��Stj|�������}|dkrd|_n
|dkrd|_|S)Nr�
postgresqlT�mssqlF)r�DefaultDialectr�_create_url�get_dialect�implicit_returning�legacy_schema_aliasing)�name�ds  r�_get_dialectr_wsr���|�t�y�(�(��%�'�'�'�
8�K�#�D�)�)�5�5�7�7�9�9���<���#'�A� � �
�W�_�_�',�A�$��rc�(�tt|fi|��S)a�Context manager which expects one or more warnings.

    With no arguments, squelches all SAWarnings emitted via
    sqlalchemy.util.warn and sqlalchemy.util.warn_limited.   Otherwise
    pass string expressions that will match selected warnings via regex;
    all non-matching warnings are sent through.

    The expect version **asserts** that the warnings were in fact seen.

    Note that the test suite sets SAWarning warnings to raise exceptions.

    )r�Warning��messagesr$s  r�expect_warningsrd�s���G�X�4�4��4�4�4rc�,��t�fd���}|S)z�Decorator form of expect_warnings().

    Note that emits_warning does **not** assert that the warnings
    were in fact seen.

    c�r��ttg��Rddi�5||i|��cddd��S#1swxYwYdS)N�assert_F)r�DeprecationWarning)�fnr#r$rcs   �r�decoratez2emits_python_deprecation_warning.<locals>.decorate�s����
�0�
K�(�
K�
K�
K�%�
K�
K�	#�	#��2�t�?�r�?�?�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�	#�	#s�,�0�0r)rcrjs` r� emits_python_deprecation_warningrk�s/����#�#�#�#��Y�#��Orc�2�ttj|fi|��Sr')r�sa_exc�SADeprecationWarningrbs  r�expect_sqlalchemy_deprecatedro�s���F�7��H�H�R�H�H�Hrc�2�ttj|fi|��Sr')rrm�RemovedIn20Warningrbs  r�expect_sqlalchemy_deprecated_20rr�s���F�5�x�F�F�2�F�F�Fr)NF)Tr'),�
__future__r�
contextlibr?r=�typingrr�
sqlalchemyrrm�sqlalchemy.enginer�sqlalchemy.testing.assertionsrr	r
rrr
r�sqlalchemy.utilr�utilrrr%r(r.r0rr6�contextmanagerr2rJrLrSrTr:r_rdrkrorrr;rr�<module>r|s���"�"�"�"�"�"�"�����	�	�	�	�
�
�
�
�������������$�$�$�$�$�$�%�%�%�%�%�%�:�:�:�:�:�:�-�-�-�-�-�-�-�-�-�-�-�-�2�2�2�2�2�2�1�1�1�1�1�1�1�1�1�1�1�1�-�-�-�-�-�-�%�%�%�%�%�%�������
�
�
�*O�O�O�;�;�;����H�H�H�BG���������������:�:�:���:�(C�C�C�C�L�L�L�L�.�.�.�.�!#�
�"�"�"�"����
5�
5�
5� 
�
�
� I�I�I�G�G�G�G�Gr

Hacked By AnonymousFox1.0, Coded By AnonymousFox