python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_atexit.cpython-312.pyc

͑eddlZddlZddlZddlZddlmZddlmZGddejZ	GddejZ
ejGdd	ejZe
d
k(rejyy)N)support)
script_helperceZdZdZy)GeneralTestcXtjd}tj|y)Nz_test_atexit.py)rfindfilerrun_test_script)selfscripts  D/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_atexit.pytest_generalzGeneralTest.test_general
s!!!"34%%f-N)__name__
__module____qualname__r
rrrr	s.rrceZdZdZdZy)FunctionalTestctjd}tjd|}|j	|j
j
jddg|j|jy)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_shutdownsc 
,,T48)446G!rctjd}tjd|}|j	|j
j
jddg|j|jy)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_instancessd 
,,T48)446I8NO!rN)rrrr&r*rrrrrs
""rrcXeZdZdZdZejeedddZ	y)SubinterpreterTestctj}tjd}t	j
|}|j
|d|j
tj|y)Nz
            import atexit
            def f():
                pass
            atexit.register(f)
            del atexit
        ratexit_ncallbacksrrrrun_in_subinterprr
nr$rets    rtest_callbacks_leakz&SubinterpreterTest.test_callbacks_leak5s`
  
&&t,a ++-q1rctj}tjd}t	j
|}|j
|d|j
tj|y)Nz
            import atexit
            def f():
                pass
            atexit.register(f)
            atexit.__atexit = atexit
        rr.r2s    rtest_callbacks_leak_refcyclez/SubinterpreterTest.test_callbacks_leak_refcycleEs`
  
&&t,a ++-q1rpipezrequires os.pipe()cZd}tj\}}tjdj	|}tj|}tj||jtj|t||tj|y)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_teardownTs}+wwy1 
F1I
&&t,
CM2H=
rN)
rrrr5r7unittest
skipUnlesshasattrr:rBrrrr,r,2s82 
2XV,.BCDrr,__main__)r/r:rrCtestrtest.supportrTestCaserrcpython_onlyr,rmainrrr<module>rLs~
	&.(##. "X&& "F	2**22jzHMMOr