HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_syntax.cpython-37.opt-2.pyc
B

��g�X�@sHddlZddlZddlmZGdd�dej�Zdd�ZedkrDe�dS)�N)�supportc@sneZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�SyntaxTestCase�
<testcase>�execNc

Cs�yt|||�Wn�tk
r�}z�|r@t||�s@|�d|j�t�|t|��}	|	dkrh|�d|f�|�|j	|�|dk	r�|�|j
|�|dk	r�|�|j|�Wdd}~XYnX|�d�dS)NzSyntaxError is not a %sz SyntaxError did not contain '%r'z#compile() did not raise SyntaxError)�compile�SyntaxError�
isinstanceZfail�__name__�re�search�strZassertEqual�filename�lineno�offset)
�self�codeZerrtextr
�mode�subclassrr�err�mo�r�,/usr/local/lib/python3.7/test/test_syntax.py�_check_errorXs zSyntaxTestCase._check_errorcCs|�dd�dS)Nzf() = 1Zassign)r)rrrr�test_assign_callpszSyntaxTestCase.test_assign_callcCs|�dd�dS)Nzdel f()�delete)r)rrrr�test_assign_delsszSyntaxTestCase.test_assign_delcCsd}|j|ddd�dS)Nz�if 1:
            def error(a):
                global a  # SyntaxError
            def error2():
                b = 1
                global b  # SyntaxError
            zparameter and global�)r)r)r�sourcerrr�test_global_param_err_firstvsz*SyntaxTestCase.test_global_param_err_firstcCsd}|j|ddd�dS)Nz�if 1:
            def error(a):
                nonlocal a  # SyntaxError
            def error2():
                b = 1
                global b  # SyntaxError
            zparameter and nonlocalr)r)r)rrrrr�test_nonlocal_param_err_first�sz,SyntaxTestCase.test_nonlocal_param_err_firstcCs|�dd�dS)N�breakzoutside loop)r)rrrr�test_break_outside_loop�sz&SyntaxTestCase.test_break_outside_loopcCs|jddtd�dS)Nz
foo()
 bar()
zunexpected indent)r)r�IndentationError)rrrr�test_unexpected_indent�sz%SyntaxTestCase.test_unexpected_indentcCs|jddtd�dS)Nzif 1:
foo()zexpected an indented block)r)rr")rrrr�test_no_indent�szSyntaxTestCase.test_no_indentcCs|jddtd�dS)Nzif 1:
  foo()
 bar()z unindent does not match .* level)r)rr")rrrr�test_bad_outdent�szSyntaxTestCase.test_bad_outdentcCs|�dd�dS)Nzint(base=10, '2')z,positional argument follows keyword argument)r)rrrr�test_kwargs_last�szSyntaxTestCase.test_kwargs_lastcCs|�dd�dS)Nzint(**{'base': 10}, '2')z6positional argument follows keyword argument unpacking)r)rrrr�test_kwargs_last2�sz SyntaxTestCase.test_kwargs_last2cCs|�dd�dS)Nzint(**{'base': 10}, *['2'])z>iterable argument unpacking follows keyword argument unpacking)r)rrrr�test_kwargs_last3�sz SyntaxTestCase.test_kwargs_last3)rrNNN)r	�
__module__�__qualname__rrrrrr!r#r$r%r&r'r(rrrrrVs


rcCs(t�t�ddlm}tj|dd�dS)Nr)�test_syntaxT)�	verbosity)rZrun_unittestr�testr+Zrun_doctest)r+rrr�	test_main�s
r.�__main__)r
Zunittestr-rZTestCaserr.r	rrrr�<module>QsR