added script to obviate nasty memory leak in Index_getitem
This commit is contained in:
17
test/test_leak.py
Normal file
17
test/test_leak.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import unittest
|
||||||
|
|
||||||
|
import utils
|
||||||
|
|
||||||
|
class TestLeak(utils.RepoTestCase):
|
||||||
|
def test_index_iter(self):
|
||||||
|
index = self.repo.index
|
||||||
|
while True:
|
||||||
|
list(index)
|
||||||
|
|
||||||
|
def test_index_getitem(self):
|
||||||
|
index = self.repo.index
|
||||||
|
while True:
|
||||||
|
index[0]
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
Reference in New Issue
Block a user