Sindbad~EG File Manager
�
(Μg@ � �R � d dl mZmZ G d� d� Z G d� d� Z G d� de� Zy) � )�copysign�isnanc � � e Zd Zd� Zy)�ExceptionIsLikeMixinc �^ � |�|�y|�| j d|� �� |�| j d|�d�� t |t � sS| j |j |j � | j |j
d |j
d � y| j |j |j � | j t |j � t |j � � t |j |j � D ] \ }}| j ||� � y)a
Passes when the provided `exc` matches the structure of `template`.
Individual exceptions don't have to be the same objects or even pass
an equality test: they only need to be the same type and contain equal
`exc_obj.args`.
Nzunexpected exception: zexpected an exception like z
, got Noner )�fail�
isinstance�ExceptionGroup�assertEqual� __class__�args�message�len�
exceptions�zip�assertExceptionIsLike)�self�exc�template�e�ts �2/usr/local/lib/python3.12/test/support/testcase.pyr z*ExceptionIsLikeMixin.assertExceptionIsLike s� � � �;�8�+�����I�I�.�s�e�4�5��;��I�I�3�H�<�z�J�K��#�~�.����S�]�]�H�,>�,>�?����S�X�X�a�[�(�-�-��*:�;����S�[�[�(�*:�*:�;����S����0�#�h�6I�6I�2J�K��C�N�N�H�,?�,?�@���1��*�*�1�a�0� A� N)�__name__�
__module__�__qualname__r � r r r r s � �1r r c � � e Zd Zd� Zy)�FloatsAreIdenticalMixinc � � d}t |� st |� rt |� r6t |� r+y||k( r%|dk7 ryt d|� t d|� k( ry|dz
}| j |j ||� � y)a# Fail unless floats x and y are identical, in the sense that:
(1) both x and y are nans, or
(2) both x and y are infinities, with the same sign, or
(3) both x and y are zeros, with the same sign, or
(4) x and y are both finite and nonzero, and x == y
z&floats {!r} and {!r} are not identicalNg g �?z: zeros have different signs)r r r �format)r �x�y�msgs r �assertFloatsAreIdenticalz0FloatsAreIdenticalMixin.assertFloatsAreIdentical sr � � 7����8�u�Q�x��Q�x�E�!�H��
�!�V��C�x���#�q�!�X�c�1�%5�5���5�5��� � �#�*�*�Q��"�#r N)r r r r% r r r r r s � �$r r c � � e Zd Zd� Zy)�ComplexesAreIdenticalMixinc � � | j |j |j � | j |j |j � y)z�Fail unless complex numbers x and y have equal values and signs.
In particular, if x and y both have real (or imaginary) part
zero, but the zeros have different signs, this test will fail.
N)r% �real�imag)r r"