summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_super.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_super.py')
-rw-r--r--Lib/test/test_super.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_super.py b/Lib/test/test_super.py
index 37fc2d9..b84863f 100644
--- a/Lib/test/test_super.py
+++ b/Lib/test/test_super.py
@@ -2,7 +2,6 @@
import sys
import unittest
-from test import support
class A:
@@ -172,9 +171,14 @@ class TestSuper(unittest.TestCase):
c = f().__closure__[0]
self.assertRaises(TypeError, X.meth, c)
-
-def test_main():
- support.run_unittest(TestSuper)
+ def test_super_init_leaks(self):
+ # Issue #26718: super.__init__ leaked memory if called multiple times.
+ # This will be caught by regrtest.py -R if this leak.
+ # NOTE: Despite the use in the test a direct call of super.__init__
+ # is not endorsed.
+ sp = super(float, 1.0)
+ for i in range(1000):
+ super.__init__(sp, int, i)
if __name__ == "__main__":