Author: Antonio Cuni <[email protected]>
Branch: continulet-no-frame-loop-2
Changeset: r93060:e8f933d33b7e
Date: 2017-11-16 18:52 +0100
http://bitbucket.org/pypy/pypy/changeset/e8f933d33b7e/

Log:    fix and simplify test_f_back_*: now that we hide the frames below
        bottomframe, a part of the test does not longer makes sense since we
        don't have any frame to check :)

diff --git a/pypy/module/_continuation/test/test_stacklet.py 
b/pypy/module/_continuation/test/test_stacklet.py
--- a/pypy/module/_continuation/test/test_stacklet.py
+++ b/pypy/module/_continuation/test/test_stacklet.py
@@ -372,9 +372,9 @@
         #
         def bar(c):
             f = sys._getframe(0)
-            assert stack() == ['bar', 'foo', 'test_f_back_no_cycles']
+            assert stack() == ['bar', 'foo']
             c.switch(f)
-            assert stack() == ['bar', 'foo', 'test_f_back_no_cycles']
+            assert stack() == ['bar', 'foo']
         def foo(c):
             bar(c)
         #
@@ -391,17 +391,13 @@
         stack = self.stack
         #
         def bar(c):
-            assert stack() == ['bar', 'foo', 'test_f_back_complex']
+            assert stack() == ['bar', 'foo']
             c.switch(sys._getframe(0))
             c.switch(sys._getframe(0).f_back)
             c.switch(sys._getframe(1))
             #
-            assert stack() == ['bar', 'foo', 'main', 'test_f_back_complex']
+            assert stack() == ['bar', 'foo']
             c.switch(sys._getframe(1).f_back)
-            #
-            assert stack() == ['bar', 'foo', 'main2', 'test_f_back_complex']
-            assert sys._getframe(2) is f3_foo.f_back
-            c.switch(sys._getframe(2))
         def foo(c):
             bar(c)
         #
@@ -416,21 +412,13 @@
         assert f1_bar.f_back is f3_foo
         #
         def main():
-            f4_main = c.switch()
-            assert f4_main.f_code.co_name == 'main'
+            f4_None = c.switch()
+            assert f4_None is None
             assert f3_foo.f_back is None    # not running
             assert stack() == ['main', 'test_f_back_complex']
             assert stack(f1_bar) == ['bar', 'foo']
         #
-        def main2():
-            f5_main2 = c.switch()
-            assert f5_main2.f_code.co_name == 'main2'
-            assert f3_foo.f_back is None    # not running
-            assert stack() == ['main2', 'test_f_back_complex']
-            assert stack(f1_bar) == ['bar', 'foo']
-        #
         main()
-        main2()
         res = c.switch()
         assert res is None
         assert f3_foo.f_back is None
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to