Author: Ronan Lamy <[email protected]>
Branch: py3.5
Changeset: r88306:cbba0303793c
Date: 2016-11-10 20:15 +0000
http://bitbucket.org/pypy/pypy/changeset/cbba0303793c/

Log:    A failing test matching
        test_frame.py::FrameLocalsTest::test_clear_locals

diff --git a/pypy/interpreter/test/test_pyframe.py 
b/pypy/interpreter/test/test_pyframe.py
--- a/pypy/interpreter/test/test_pyframe.py
+++ b/pypy/interpreter/test/test_pyframe.py
@@ -601,3 +601,29 @@
             pass
         sys.settrace(None)
         assert seen == ['call', 'exception', 'return']
+
+    def test_clear_locals(self):
+        def make_frames():
+            def outer():
+                x = 5
+                y = 6
+                def inner():
+                    z = x + 2
+                    1/0
+                    t = 9
+                return inner()
+            try:
+                outer()
+            except ZeroDivisionError as e:
+                tb = e.__traceback__
+                frames = []
+                while tb:
+                    frames.append(tb.tb_frame)
+                    tb = tb.tb_next
+            return frames
+
+        f, outer, inner = make_frames()
+        outer.clear()
+        inner.clear()
+        assert not outer.f_locals
+        assert not inner.f_locals
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to