Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.133.120.119
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_print.cpython-310.pyc
o

ab��	@s�ddlZddlZddlmZddlmZe�Zdd�dd�dd�dd�d	d�d
d�dd�dd�d
�ZGdd�d�Z	Gdd�dej
�ZGdd�dej
�Ze
dkrUe��dSdS)�N)�StringIO)�supportcCst|�S�N��print��args�sep�end�file�r�8/usr/local/python-3.10/lib/python3.10/test/test_print.py�<lambda>srcCst|d|i�S)Nrrrrrr
r�cCst|d|i�S)Nr
rrrrr
rrcCst|||d��S)N)r
rrrrrr
r�cCst|d|i�S)Nr	rrrrr
rrcCst|||d��S)N)r	rrrrrr
rrcCst|||d��S)N�r	r
rrrrr
rrcCst||||d��S)N�r	r
rrrrrr
rs))FFF)FFT)FTF)FTT)TFF)TFT)TTF)TTTc@�eZdZdd�Zdd�ZdS)�ClassWith__str__cCs
||_dSr��x��selfrrrr
�__init__$s
zClassWith__str__.__init__cCs|jSrr�rrrr
�__str__'szClassWith__str__.__str__N)�__name__�
__module__�__qualname__rrrrrr
r#�rc@s0eZdZdZeeefdd�Zdd�Zdd�ZdS)	�	TestPrintz-Test correct operation of the print function.cCsdt|tu|tu|tuf}t���}|||||�Wd�n1s#wY|�|��|�dSr)�dispatch�
NotDefinedrZcaptured_stdout�assertEqual�getvalue)r�expectedrr	r
r�fn�trrr
�check.s�
�zTestPrint.checkcs<ttf�fdd�	}|dd�|dd�|dd�|d	d
�|dd�|d
d
dd�|dddd�|dddd�|ddddd�|ddddd�|dddd�|dddd�|d d�|d ddd�|d ddd�|d dddd�|d!td�f�|d"td#�d$f��jttdd%d��jttdd%d��jttddd&�dS)'Ncs@�j||||d�t�}�jd||||d���|��|�dS)Nr�r)r(rr#r$)r%rr	r
�orrr
r@szTestPrint.test_print.<locals>.x�
r�a
)�azNone
rz1 2
)��z1   2
)r.� r/z1*2
�*)r	z1 s)r.�sr))r
za
b
)r-�bz1.01)g�?r.rz1*a*1.3+)r.r-g�������?�+za

b
)r,r3z+ +
)�r0r5za
 b
z*
zabc 1
�abcr.�)r)r"r�assertRaises�	TypeErrorr�AttributeErrorrrrr
�
test_print?s,





zTestPrint.test_printcCs�Gdd�d�}|�}td|ddd�td|ddd�td|d	d
�|�|jd�|�|jd�Gdd
�d
�}|jttd|�dd
�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z,TestPrint.test_print_flush.<locals>.filelikecSsd|_d|_dS)Nr)r)�written�flushedrrrr
rjs
z5TestPrint.test_print_flush.<locals>.filelike.__init__cSs|j|7_dSr)r<�r�strrrr
�writen�z2TestPrint.test_print_flush.<locals>.filelike.writecSs|jd7_dS)Nr.)r=rrrr
�flushqrAz2TestPrint.test_print_flush.<locals>.filelike.flushN)rrrrr@rBrrrr
�filelikeisrCr.r)T)rr
rBr/r7F)rrBz123
c@r)z+TestPrint.test_print_flush.<locals>.noflushcSsdSrrr>rrr
r@}�z1TestPrint.test_print_flush.<locals>.noflush.writecSst�r)�RuntimeErrorrrrr
rB�rDz1TestPrint.test_print_flush.<locals>.noflush.flushN)rrrr@rBrrrr
�noflush|rrF)rr#r<r=r8rE)rrC�frFrrr
�test_print_flushgszTestPrint.test_print_flushN)rrr�__doc__r"r(r;rHrrrr
r +s
�(r c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�TestPy2MigrationHintzwTest that correct hint is produced analogous to Python3 syntax,
    if print statement is executed as in Python 2.
    cC�Ld}|�t��}t|�Wd�n1swY|�dt|j��dS)Nzprint "Hello World"�?Missing parentheses in call to 'print'. Did you mean print(...)�r8�SyntaxError�exec�assertInr?�	exception�rZpython2_print_str�contextrrr
�test_normal_string��
��z'TestPy2MigrationHint.test_normal_stringcCrK)Nzprint "Hello World",rLrMrRrrr
�test_string_with_soft_space�rUz0TestPy2MigrationHint.test_string_with_soft_spacecCrK)Nzprint  "Hello World", rLrMrRrrr
�%test_string_with_excessive_whitespace�rUz:TestPy2MigrationHint.test_string_with_excessive_whitespacecCrK)Nz.if 1:
            print "Hello World"
        rLrMrRrrr
�#test_string_with_leading_whitespace�s
��z8TestPy2MigrationHint.test_string_with_leading_whitespacecCrK)Nzprint p;rLrMrRrrr
�test_string_with_semicolon�rUz/TestPy2MigrationHint.test_string_with_semicoloncCrK)Nzfor i in s: print irLrMrRrrr
� test_string_in_loop_on_same_line�rUz5TestPy2MigrationHint.test_string_in_loop_on_same_linecCs>|�t��}ttj?dfWd�n1swY|�dt|j��|�t��}td?Wd�n1s9wY|�dt|j��|�t��
}ttj?Wd�n1s\wY|�	dt|j��|�t��
}ttj>Wd�n1swY|�	dt|j��Gdd�d�}|�
t|�?d�dS)N�messagez6Did you mean "print(<message>, file=<output_stream>)"?�*z
Did you mean zDid you meanc@seZdZdd�ZdS)z\TestPy2MigrationHint.test_stream_redirection_hint_for_py2_migration.<locals>.OverrideRRShiftcSsdS)Nr\r)rZlhsrrr
�__rrshift__�rDzhTestPy2MigrationHint.test_stream_redirection_hint_for_py2_migration.<locals>.OverrideRRShift.__rrshift__N)rrrr]rrrr
�OverrideRRShift�sr^)r8r9r�sys�stderrrPr?rQ�maxZassertNotInr#)rrSr^rrr
�.test_stream_redirection_hint_for_py2_migration�s,��
����zCTestPy2MigrationHint.test_stream_redirection_hint_for_py2_migrationN)rrrrIrTrVrWrXrYrZrbrrrr
rJ�s
rJ�__main__)Zunittestr_�ior�testr�objectr"r!rZTestCaser rJr�mainrrrr
�<module>s(	�Z[�
© 2025 GrazzMean