python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
test_atexit.cpython-311.opt-1.pyc

eddlZddlZddlZddlZddlZddlmZddlmZGddej	Z
Gddej	ZejGdd	ej	Z
ed
krejdSdS)N)support)
script_helperceZdZdZdS)GeneralTestcVtjd}tj|dS)Nz_test_atexit.py)rfindfilerrun_test_script)selfscripts  D/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_atexit.pytest_generalzGeneralTest.test_generals*!"344%f-----N)__name__
__module____qualname__r
rrrr
s#.....rrceZdZdZdZdS)FunctionalTestctjd}tjd|}||jddg||j	dS)Nz
            import atexit

            def f(msg):
                print(msg)

            atexit.register(f, "one")
            atexit.register(f, "two")
        -ctwoone
textwrapdedentrassert_python_okassertEqualoutdecode
splitlinesassertFalseerrr
coderess   r
test_shutdownzFunctionalTest.test_shutdownsz 

,T488))4466GGG!!!!!rctjd}tjd|}||jddg||j	dS)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")
        ratexit2atexit1rr#s   rtest_atexit_instancesz$FunctionalTest.test_atexit_instances s{ 

,T488))4466I8NOOO!!!!!rN)rrrr&r*rrrrrs2
"
"
""""""rrcbeZdZdZdZejeedddZ	dS)SubinterpreterTestctj}tjd}t	j|}||d|tj|dS)Nz
            import atexit
            def f():
                pass
            atexit.register(f)
            del atexit
        ratexit_ncallbacksrrrrun_in_subinterprr
nr$rets    rtest_callbacks_leakz&SubinterpreterTest.test_callbacks_leak6su
   

&t,,a   +--q11111rctj}tjd}t	j|}||d|tj|dS)Nz
            import atexit
            def f():
                pass
            atexit.register(f)
            atexit.__atexit = atexit
        rr.r2s    rtest_callbacks_leak_refcyclez/SubinterpreterTest.test_callbacks_leak_refcycleFsu
   

&t,,a   +--q11111rpipezrequires os.pipe()chd}tj\}}tjd|}tj|}tj||tj	|t||tj|dS)NsThe test has passed!z
            import os
            import atexit
            def callback():
                os.write({:d}, b"The test has passed!")
            atexit.register(callback)
        )osr8rrformatrr1closerreadlen)r
expectedrwr$r4s      r(test_callback_on_subinterpreter_teardownz;SubinterpreterTest.test_callback_on_subinterpreter_teardownUs+wyy1 
F1II
&t,,
CMM22H===
rN)
rrrr5r7unittest
skipUnlesshasattrr:rBrrrr,r,3sk222 
2
2
2XV,,.BCCDCrr,__main__)r/r:sysrrCtestrtest.supportrTestCaserrcpython_onlyr,rmainrrr<module>rMs



				



&&&&&&.....(#... " " " " "X& " " "F	22222*222jzHMOOOOOr