summaryrefslogtreecommitdiffstats
path: root/Lib/test/mapping_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/mapping_tests.py')
-rw-r--r--Lib/test/mapping_tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/mapping_tests.py b/Lib/test/mapping_tests.py
index f43750b..248dee2 100644
--- a/Lib/test/mapping_tests.py
+++ b/Lib/test/mapping_tests.py
@@ -2,6 +2,7 @@
import unittest
import UserDict
import test_support
+import sys
class BasicTestMappingProtocol(unittest.TestCase):
@@ -645,6 +646,14 @@ class TestHashMappingProtocol(TestMappingProtocol):
d = self._full_mapping({1: BadRepr()})
self.assertRaises(Exc, repr, d)
+ def test_repr_deep(self):
+ d = self._empty_mapping()
+ for i in range(sys.getrecursionlimit() + 100):
+ d0 = d
+ d = self._empty_mapping()
+ d[1] = d0
+ self.assertRaises(RuntimeError, repr, d)
+
def test_le(self):
self.assertTrue(not (self._empty_mapping() < self._empty_mapping()))
self.assertTrue(not (self._full_mapping({1: 2}) < self._full_mapping({1L: 2L})))