summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorRémi Lapeyre <remi.lapeyre@henki.fr>2019-03-15 06:53:34 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2019-03-15 06:53:34 (GMT)
commit65f64b1903ae85b97a30f514bbc1b7ce940c3af2 (patch)
treee5c7726b578c7a37492366807927f3682df87681 /Lib/test
parent1c668d16574d47cffd469e00930f39afac927288 (diff)
downloadcpython-65f64b1903ae85b97a30f514bbc1b7ce940c3af2.zip
cpython-65f64b1903ae85b97a30f514bbc1b7ce940c3af2.tar.gz
cpython-65f64b1903ae85b97a30f514bbc1b7ce940c3af2.tar.bz2
bpo-36272: Logging now propagates RecursionError (GH-12312)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_logging.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index c797d66..b23ae24 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -41,7 +41,7 @@ import socket
import struct
import sys
import tempfile
-from test.support.script_helper import assert_python_ok
+from test.support.script_helper import assert_python_ok, assert_python_failure
from test import support
import textwrap
import threading
@@ -4142,6 +4142,21 @@ class ModuleLevelMiscTest(BaseTest):
self.assertIn("exception in __del__", err)
self.assertIn("ValueError: some error", err)
+ def test_recursion_error(self):
+ # Issue 36272
+ code = """if 1:
+ import logging
+
+ def rec():
+ logging.error("foo")
+ rec()
+
+ rec()"""
+ rc, out, err = assert_python_failure("-c", code)
+ err = err.decode()
+ self.assertNotIn("Cannot recover from stack overflow.", err)
+ self.assertEqual(rc, 1)
+
class LogRecordTest(BaseTest):
def test_str_rep(self):