summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dict.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r--Lib/test/test_dict.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index 32ffd38..66f5d56 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -892,6 +892,14 @@ class DictTest(unittest.TestCase):
gc.collect()
self.assertTrue(gc.is_tracked(t), t)
+ def test_string_keys_can_track_values(self):
+ # Test that this doesn't leak.
+ for i in range(10):
+ d = {}
+ for j in range(10):
+ d[str(j)] = j
+ d["foo"] = d
+
@support.cpython_only
def test_track_literals(self):
# Test GC-optimization of dict literals