
    Yg@	                     R    d dl mZmZ  G d d      Z G d d      Z G d de      Zy)	    )copysignisnanc                       e Zd Zd Zy)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`.
        Nzunexpected exception: zexpected an exception like z
, got Noner   )fail
isinstanceExceptionGroupassertEqual	__class__argsmessagelen
exceptionszipassertExceptionIsLike)selfexctemplateets        'lib/python3.12/test/support/testcase.pyr   z*ExceptionIsLikeMixin.assertExceptionIsLike   s     ;8+II.se45;II3H<zJK#~.S]]H,>,>?SXXa[(--*:;S[[(*:*:;S0#h6I6I2JKCNNH,?,?@1**1a0 A    N)__name__
__module____qualname__r    r   r   r   r      s    1r   r   c                       e Zd Zd Zy)FloatsAreIdenticalMixinc                     d}t        |      st        |      rt        |      r6t        |      r+y||k(  r%|dk7  ryt        d|      t        d|      k(  ry|dz  }| 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8uQxQxE!H!VCx#q!Xc1%5555		#**Q"#r   N)r   r   r   r%   r   r   r   r   r      s    $r   r   c                       e Zd Zd Zy)ComplexesAreIdenticalMixinc                     | j                  |j                  |j                         | j                  |j                  |j                         y)zFail 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"   r#   s      r   assertComplexesAreIdenticalz6ComplexesAreIdenticalMixin.assertComplexesAreIdentical9   s4     	%%affaff5%%affaff5r   N)r   r   r   r+   r   r   r   r'   r'   8   s    6r   r'   N)mathr   r   r   r   r'   r   r   r   <module>r-      s)     1 16$ $2	6!8 	6r   