Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/mako/testing/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/mako/testing/__pycache__/assertions.cpython-38.pyc
U

O��g)�@s�ddlZddlZddlZd*dd�Zd+dd�Zd,dd�Zd-dd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd.dd�ZGdd�d�Zejd/dd ��Zd0d!d"�Zd1d#d$�Zd2d&d'�Zd3d(d)�ZdS)4�NcCs ||kst|pd||f��dS)z.Assert a == b, with repr messaging on failure.z%r != %rN��AssertionError��a�b�msg�r�D/opt/cppython/lib/python3.8/site-packages/mako/testing/assertions.py�eq_sr
cCs ||kst|pd||f��dS)z.Assert a != b, with repr messaging on failure.z%r == %rNrrrrr	�ne_srcCs ||kst|pd||f��dS)z.Assert a in b, with repr messaging on failure.z%r not in %rNrrrrr	�in_srcCs ||kst|pd||f��dS)z2Assert a in not b, with repr messaging on failure.z%r is in %rNrrrrr	�not_insr
cCs,|j|jk	r(|js(ds(td||jf��dS)�Gassert 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.

    FzZException %r was correctly raised but did not set a cause, within context %r as its cause.N)�__context__�	__cause__�__suppress_context__r)�	exceptionrrr	� _assert_proper_exception_contexts
����rcCs$t|j|�s td||j|f��dS)rzcException %r was correctly raised but has cause %r, which does not have the expected cause type %r.N)�
isinstancerr)r�	cause_clsrrr	�_assert_proper_cause_cls/s
	
��rcOst||||�S�N��_assert_raises��
except_cls�	callable_�args�kwrrr	�
assert_raises?srcOst||||dd�S)NT��
check_contextrrrrr	�!assert_raises_with_proper_contextCsr"cOst|||||d�S)N)rr)rrrrrrrr	�assert_raises_with_given_causeGsr#cOst|||||d�S)N)rr�rrrr�kwargsrrr	�assert_raises_messageMsr&cOst|||||dd�S)NT�rr!rr$rrr	�)assert_raises_message_with_proper_contextQs�r(cOst||||||d�S)N)rrr)rrrrrr%rrr	�&assert_raises_message_with_given_causeYs�r)Fc	Cs*t||||��}|||�W5QRX|jSr)�_expect_raises�error)rrrr%rr!r�ecrrr	ras	rc@seZdZdZdS)�_ErrorContainerN)�__name__�
__module__�__qualname__r+rrrr	r-osr-c	
cs�t�}|rt��d}z|Vd}Wn�|k
r�}zr||_d}|dk	rpt|�}t�||tj�sptd||f��|dk	r�t	||�|r�|s�t
|�tt|��d��W5d}~XYnX~|s�td��dS)NrFTz%r !~ %szutf-8z#Callable did not raise an exception)
r-�sys�exc_infor+�str�re�search�UNICODErrr�print�encode)	rrr!rr,Zare_we_already_in_a_traceback�success�errZerror_as_stringrrr	r*ss,�
$r*cCst||d�S�Nr �r*�rr!rrr	�
expect_raises�sr>cCst|||d�S�Nr'r<�rrr!rrr	�expect_raises_message�srATcCst||d�Sr;r<r=rrr	�!expect_raises_with_proper_context�srBcCst|||d�Sr?r<r@rrr	�)expect_raises_message_with_proper_context�srC)N)N)N)N)NFN)NFN)F)F)T)T)�
contextlibr4r1r
rrr
rrrr"r#r&r(r)rr-�contextmanagerr*r>rArBrCrrrr	�<module>s4




�
#


�

F1le Man4ger