projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b65df7
)
Add test for memory leak reported in issue 9422.
author
Mark Dickinson
<dickinsm@gmail.com>
Sun, 1 Aug 2010 11:10:28 +0000
(11:10 +0000)
committer
Mark Dickinson
<dickinsm@gmail.com>
Sun, 1 Aug 2010 11:10:28 +0000
(11:10 +0000)
Lib/test/test_struct.py
patch
|
blob
|
history
diff --git
a/Lib/test/test_struct.py
b/Lib/test/test_struct.py
index 6ca35ca31cf972f96b9727fbf29ae5ecd3dc879f..6ac8fdcc9c52c1911f71f965a27db63857b81040 100644
(file)
--- a/
Lib/test/test_struct.py
+++ b/
Lib/test/test_struct.py
@@
-560,7
+560,12
@@
class StructTest(unittest.TestCase):
'spam and eggs')
self.assertRaises(struct.error, struct.unpack_from, '14s42', store, 0)
-
+ def test_Struct_reinitialization(self):
+ # Issue 9422: there was a memory leak when reinitializing a
+ # Struct instance. This test can be used to detect the leak
+ # when running with regrtest -L.
+ s = struct.Struct('i')
+ s.__init__('ii')
def test_main():
run_unittest(StructTest)