
    <e                         	 d dl mZ d dlmZ d dlZd dlZ G d dej                  Zd Ze	dk    r ej
                     dS dS )    check_syntax_error)check_warningsNc                   ,    e Zd Zd Zd Zd Zd Zd ZdS )GlobalTestsc                 t    |                      t                                 t          j        dd           d S Nerror<test string>)module)enterContextr   warningsfilterwarnings)selfs    '/usr/lib/python3.11/test/test_global.pysetUpzGlobalTests.setUp   s8    .**+++@@@@@@    c                 0    d}t          | |dd           d S )Nz<def wrong1():
    a = 1
    b = 2
    global a
    global b
      linenooffsetr   )r   prog_text_1s     r   test1zGlobalTests.test1   s(     	4QqAAAAAAr   c                 0    d}t          | |dd           d S )Nz(def wrong2():
    print(x)
    global x
   r   r   r   )r   prog_text_2s     r   test2zGlobalTests.test2   s(    
 	4QqAAAAAAr   c                 0    d}t          | |dd           d S )Nz2def wrong3():
    print(x)
    x = 2
    global x
r   r   r   r   )r   prog_text_3s     r   test3zGlobalTests.test3!   s(     	4QqAAAAAAr   c                 ,    d}t          |dd           d S )Nzglobal x
x = 2
r   exec)compile)r   prog_text_4s     r   test4zGlobalTests.test4*   s#    
 	_f55555r   N)__name__
__module____qualname__r   r   r   r"   r'    r   r   r   r   	   sk        A A AB B BB B BB B B6 6 6 6 6r   r   c                  |    t          j        t          j                               t          j        dd           d S r	   )unittestenterModuleContextr   catch_warningsr   r+   r   r   setUpModuler0   3   s8     7 9 9:::GO<<<<<<r   __main__)test.supportr   test.support.warnings_helperr   r-   r   TestCaser   r0   r(   mainr+   r   r   <module>r6      s    J + + + + + + 7 7 7 7 7 7  '6 '6 '6 '6 '6(# '6 '6 '6T= = =
 zHMOOOOO r   