zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
U
¸ý°dd ã@sNddlZddlZddlZddlmZddlmZejs:t‚Gdd„deƒZ    dS)éNé)ÚTestCase)Úfails_leakcheckc@s0eZdZdd„Zdd„Zdd„Zedd„ƒZd    S)
ÚGCTestscCsbt t tj¡ ¡¡}t ¡|ƒdk    rBddl}td|     |ƒ¡ƒ| 
|ƒ¡|  tj tj ¡dS)NrzO IS NOT NONE.) ÚweakrefÚrefÚgreenletÚ
getcurrentÚswitchÚgcÚcollectÚsysÚprintÚ getrefcountÚ assertIsNoneÚ assertFalseÚgarbage)ÚselfÚor ©rúMd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\greenlet/tests/test_gc.pyÚtest_dead_circular_refs
 zGCTests.test_dead_circular_refcCsPGdd„dtjƒ}|ƒ}||_t |¡}t ¡| |ƒ¡| tjtj¡dS)Nc@s eZdZdS)z9GCTests.test_circular_greenlet.<locals>.circular_greenletN)Ú__name__Ú
__module__Ú __qualname__rrrrÚcircular_greenletsr)    rrrrr r rrr)rrrrrrÚtest_circular_greenlets
 zGCTests.test_circular_greenletcCsJGdd„dtjƒ}|ƒ}t |¡}t ¡| |ƒ¡| tjtj¡dS)Nc@seZdZdd„Zdd„ZdS)z4GCTests.test_inactive_ref.<locals>.inactive_greenletcSstjj||jddS)N)Úrun)rÚ__init__r©rrrrr$sz=GCTests.test_inactive_ref.<locals>.inactive_greenlet.__init__cSsdS©Nrrrrrr'sz8GCTests.test_inactive_ref.<locals>.inactive_greenlet.runN)rrrrrrrrrÚinactive_greenlet#sr!)rrrr r rrr)rr!rrrrÚtest_inactive_ref"s 
 zGCTests.test_inactive_refcsdGdd„dtƒ‰g}t ¡‰‡‡fdd„}t |¡}||_| |¡| ¡~~t ¡t ¡dS)Nc@seZdZdd„ZdS)z;GCTests.test_finalizer_crash.<locals>.object_with_finalizercSsdSr rrrrrÚ__del__CszCGCTests.test_finalizer_crash.<locals>.object_with_finalizer.__del__N)rrrr#rrrrÚobject_with_finalizerBsr$csLˆƒt ¡_z0z ˆ ¡Wntjk
r8tdƒYnXW5t ¡`XdS)NzGot greenlet exit!)rr    Úobjectr
Z GreenletExitrr©r$ÚparentrrÚ greenlet_bodyGs   z3GCTests.test_finalizer_crash.<locals>.greenlet_body)r%rr    ÚarrayÚappendr
r r )rr)r(Úgrr&rÚtest_finalizer_crash/s
 
zGCTests.test_finalizer_crashN)rrrrrr"rr,rrrrrs
    
 r)
r rrÚrZ    leakcheckrZGREENLET_USE_GCÚAssertionErrorrrrrrÚ<module>s