diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-03 05:04:23 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-03 05:04:23 (GMT) |
commit | f488fb422a641aa7c38eb63c09f459e4baff7bc4 (patch) | |
tree | f09d64f919af622c0ebf28adb9a3bfec567e47c8 /Lib/test/test_json | |
parent | 27be130ec71fa95e2496bd9e42505aa6c7457682 (diff) | |
download | cpython-f488fb422a641aa7c38eb63c09f459e4baff7bc4.zip cpython-f488fb422a641aa7c38eb63c09f459e4baff7bc4.tar.gz cpython-f488fb422a641aa7c38eb63c09f459e4baff7bc4.tar.bz2 |
Issue #19235: Add new RecursionError exception. Patch by Georg Brandl.
Diffstat (limited to 'Lib/test/test_json')
-rw-r--r-- | Lib/test/test_json/test_recursion.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_json/test_recursion.py b/Lib/test/test_json/test_recursion.py index 1a76254..877dc44 100644 --- a/Lib/test/test_json/test_recursion.py +++ b/Lib/test/test_json/test_recursion.py @@ -68,11 +68,11 @@ class TestRecursion: def test_highly_nested_objects_decoding(self): # test that loading highly-nested objects doesn't segfault when C # accelerations are used. See #12017 - with self.assertRaises(RuntimeError): + with self.assertRaises(RecursionError): self.loads('{"a":' * 100000 + '1' + '}' * 100000) - with self.assertRaises(RuntimeError): + with self.assertRaises(RecursionError): self.loads('{"a":' * 100000 + '[1]' + '}' * 100000) - with self.assertRaises(RuntimeError): + with self.assertRaises(RecursionError): self.loads('[' * 100000 + '1' + ']' * 100000) def test_highly_nested_objects_encoding(self): @@ -80,9 +80,9 @@ class TestRecursion: l, d = [], {} for x in range(100000): l, d = [l], {'k':d} - with self.assertRaises(RuntimeError): + with self.assertRaises(RecursionError): self.dumps(l) - with self.assertRaises(RuntimeError): + with self.assertRaises(RecursionError): self.dumps(d) def test_endless_recursion(self): @@ -92,7 +92,7 @@ class TestRecursion: """If check_circular is False, this will keep adding another list.""" return [o] - with self.assertRaises(RuntimeError): + with self.assertRaises(RecursionError): EndlessJSONEncoder(check_circular=False).encode(5j) |