D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
hc_python
/
lib64
/
python3.8
/
site-packages
/
greenlet
/
tests
/
Filename :
test_stack_saved.py
back
Copy
import greenlet from . import TestCase class Test(TestCase): def test_stack_saved(self): main = greenlet.getcurrent() self.assertEqual(main._stack_saved, 0) def func(): main.switch(main._stack_saved) g = greenlet.greenlet(func) x = g.switch() self.assertGreater(x, 0) self.assertGreater(g._stack_saved, 0) g.switch() self.assertEqual(g._stack_saved, 0)