PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/hc_python/lib/python3.12/site-packages/alembic/testing/__pycache__/
Upload File :
Current File : //opt/hc_python/lib/python3.12/site-packages/alembic/testing/__pycache__/assertions.cpython-312.pyc

�

���gL��p�UddlmZddlZddlZddlZddlmZddlmZddlm	Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZd�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*y)(�)�annotationsN)�Any)�Dict)�exc)�default)�URL)�_expect_warnings)�eq_)�is_)�is_false)�is_not_)�is_true)�ne_��	decoratorc�~�|j|jur%|jsJd|�d|j�d���yy)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.

    z
Exception z> was correctly raised but did not set a cause, within context z as its cause.N)�__context__�	__cause__�__suppress_context__)�	exceptions �I/opt/hc_python/lib/python3.12/site-packages/alembic/testing/assertions.py� _assert_proper_exception_contextrsI��	���Y�%8�%8�8��.�.�	
��)�/�/�
1�	
�u�/�	9�c�"�t||||d��S)NT��
check_context��_assert_raises��
except_cls�	callable_�args�kws    r�
assert_raisesr$+s���*�i��r��N�Nrc��t||||�S�Nrrs    r�assert_raises_context_okr'/s���*�i��r�:�:rc�$�t|||||d��S)NT)�msgrr�r r)r!r"�kwargss     r�assert_raises_messager,3s����I�t�V��D��rc�"�t|||||��S)N)r)rr*s     r� assert_raises_message_context_okr.9s���*�i��v�3�G�Grc��t|||�5}||i|��ddd�|jS#1swYjSxYwr&)�_expect_raises�error)r r!r"r+r)r�ecs       rrr?s<��
�
�C��	7�2��4�"�6�"�
8�
�8�8�O�
8�
�8�8�O�s�	+�?c��eZdZUdZded<y)�_ErrorContainerNrr1)�__name__�
__module__�__qualname__r1�__annotations__�rrr4r4Gs���E�3�rr4c#�K�t�}|rtj�d}	|��d}|sJd��y#|$r�}||_d}|�V|rt	|�|k(sFJ|�d|����tj|t	|�t
j�sJ|�d|����|r
st|�tt	|�jd��Yd}~��d}~wwxYw�w)NrFT� != z !~ zutf-8z#Callable did not raise an exception)r4�sys�exc_infor1�str�re�search�UNICODEr�print�encode)r r)r�
text_exactr2�are_we_already_in_a_traceback�success�errs        rr0r0Ks�����
�	�B��(+����q�(9�%�
(������9�9�9�7���
(�������?���3�x�3��9�3�%�t�C�5�(9�9���y�y��c�#�h��
�
�;�N��u�D���=N�N�;��!>�,�S�1�
�c�#�h�o�o�g�&�'�'��
(�s+�$C�7�
C�C�BC�C�C�Cc��t||��S)Nr�r0)r rs  r�
expect_raisesrJes���*�M�B�Brc� �t||||��S)N)r)rrDrI)r r)rrDs    r�expect_raises_messagerLis�����=�Z��rc���tjdd|�}tjdd|�}tjdd|�}tjdd|�}||k(sJ|xs|�d|����y)Nz^\s+?|\n�z {2,}� r;)r?�sub)�a�br)s   r�eq_ignore_whitespacerSqse��
���{�B��"�A�
���x��a� �A�
���{�B��"�A�
���x��a� �A���6�-�3�-��1�-�-�6rzDict[Any, Any]�
_dialect_modsc��|�|dk(rtj�Stj|�j	��}|dk(r	d|_|S|dk(rd|_|S)Nr�
postgresqlT�mssqlF)r�DefaultDialectr�create�get_dialect�implicit_returning�legacy_schema_aliasing)�name�ds  r�_get_dialectr_}sf���|�t�y�(��%�%�'�'�*�C�J�J�t��(�(�*�,���<��#'�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�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�f��ttg���ddi�5||i|��cddd�S#1swYyxYw)N�assert_F)r	�DeprecationWarning)�fnr"r#rcs   �r�decoratez2emits_python_deprecation_warning.<locals>.decorate�s.���
�0�
K�(�
K�%�
K��t�?�r�?�L�
K�
K�s�'�0r)rcrjs` r� emits_python_deprecation_warningrk�s����#��#��Orc�8�ttj|fi|��Sr&)r	�sa_exc�SADeprecationWarningrbs  r�expect_sqlalchemy_deprecatedro�s���F�7�7��H�R�H�Hrc�8�ttj|fi|��Sr&)r	rm�RemovedIn20Warningrbs  r�expect_sqlalchemy_deprecated_20rr�s���F�5�5�x�F�2�F�Fr)NF)NFF)T)TFr&)+�
__future__r�
contextlibr?r<�typingrr�
sqlalchemyrrm�sqlalchemy.enginerr�sqlalchemy.testing.assertionsr	r
rrr
rr�sqlalchemy.utilrrr$r'r,r.rr4�contextmanagerr0rJrLrSrTr8r_rdrkrorrr9rr�<module>r{s���"��	�
���$�%�!�:�-�-�2�1�1�-�%�
�*O�;��H�BG�������:?�:��:�2C�
5:��.�!#�
�~�"�
�
5� 
� I�Gr

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic