summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_tracemalloc.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py
index d2a5ede..94bcee3 100644
--- a/Lib/test/test_tracemalloc.py
+++ b/Lib/test/test_tracemalloc.py
@@ -360,6 +360,20 @@ class TestTracemallocEnabled(unittest.TestCase):
else:
support.wait_process(pid, exitcode=0)
+ def test_no_incomplete_frames(self):
+ tracemalloc.stop()
+ tracemalloc.start(8)
+
+ def f(x):
+ def g():
+ return x
+ return g
+
+ obj = f(0).__closure__[0]
+ traceback = tracemalloc.get_object_traceback(obj)
+ self.assertIn("test_tracemalloc", traceback[-1].filename)
+ self.assertNotIn("test_tracemalloc", traceback[-2].filename)
+
class TestSnapshot(unittest.TestCase):
maxDiff = 4000