[3.6] bpo-36272: Logging now propagates RecursionError (GH-12312) by miss-islington · Pull Request #12339 · python/cpython
Expand Up
@@ -39,7 +39,7 @@
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 time
Expand Down
Expand Up
@@ -3699,6 +3699,21 @@ def __del__(self):
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): Expand Down
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): Expand Down