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: 52.14.196.242
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_atexit.cpython-310.pyc
o

`b��@s�ddlZddlZddlZddlZddlZddlmZddlmZGdd�dej	�Z
Gdd�dej	�ZejGdd	�d	ej	��Z
ed
krHe��dSdS)�N)�support)�
script_helperc@seZdZdd�ZdS)�GeneralTestcCst�d�}t�|�dS)Nz_test_atexit.py)rZfindfilerZrun_test_script)�selfZscript�r�9/usr/local/python-3.10/lib/python3.10/test/test_atexit.py�test_generals
zGeneralTest.test_generalN)�__name__�
__module__�__qualname__rrrrrr
src@seZdZdd�Zdd�ZdS)�FunctionalTestcC�@t�d�}t�d|�}|�|j����ddg�|�|j	�dS)Nz�
            import atexit

            def f(msg):
                print(msg)

            atexit.register(f, "one")
            atexit.register(f, "two")
        �-cZtwoZone�
�textwrap�dedentrZassert_python_ok�assertEqual�out�decode�
splitlinesZassertFalse�err�r�code�resrrr�
test_shutdowns
	zFunctionalTest.test_shutdowncCr
)Na@
            import sys
            import atexit as atexit1
            del sys.modules['atexit']
            import atexit as atexit2
            del sys.modules['atexit']

            assert atexit2 is not atexit1

            atexit1.register(print, "atexit1")
            atexit2.register(print, "atexit2")
        rZatexit2Zatexit1rrrrr�test_atexit_instances s
z$FunctionalTest.test_atexit_instancesN)r	r
rrrrrrrrsrc@s$eZdZdd�Zdd�Zdd�ZdS)�SubinterpreterTestcC�<t��}t�d�}t�|�}|�|d�|�t��|�dS)Nz�
            import atexit
            def f():
                pass
            atexit.register(f)
            del atexit
        r��atexit�_ncallbacksrrr�run_in_subinterpr�r�nr�retrrr�test_callbacks_leak6s


z&SubinterpreterTest.test_callbacks_leakcCr)Nz�
            import atexit
            def f():
                pass
            atexit.register(f)
            atexit.__atexit = atexit
        rrr"rrr�test_callbacks_leak_refcycleFs


z/SubinterpreterTest.test_callbacks_leak_refcyclecCsZd}t��\}}t�d�|��}t�|�}t�|�|�t�	|t
|��|�t�|�dS)NsThe test has passed!z�
            import os
            import atexit
            def callback():
                os.write({:d}, b"The test has passed!")
            atexit.register(callback)
        )�os�piperr�formatrr!�closer�read�len)rZexpected�r�wrr$rrr�(test_callback_on_subinterpreter_teardownUs�

z;SubinterpreterTest.test_callback_on_subinterpreter_teardownN)r	r
rr%r&r/rrrrr3sr�__main__)rr'�sysrZunittest�testrZtest.supportrZTestCaserrZcpython_onlyrr	�mainrrrr�<module>s#4�
© 2025 GrazzMean