summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorErik Montnemery <erik@montnemery.com>2022-07-05 14:23:12 (GMT)
committerGitHub <noreply@github.com>2022-07-05 14:23:12 (GMT)
commitc60f125533b8808317c1370450f0535430d59d8c (patch)
treef7ae0ef6c786f91dcbd9b15498d1d6d5c32b784f /Lib/test
parent324d01944d16868b07df9e8eef6987766a31a36d (diff)
downloadcpython-c60f125533b8808317c1370450f0535430d59d8c.zip
cpython-c60f125533b8808317c1370450f0535430d59d8c.tar.gz
cpython-c60f125533b8808317c1370450f0535430d59d8c.tar.bz2
bpo-46755: Don't log stack info twice in QueueHandler (GH-31355)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_logging.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 0aec072..a900dab 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -3808,7 +3808,7 @@ class QueueHandlerTest(BaseTest):
@unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'),
'logging.handlers.QueueListener required for this test')
def test_queue_listener_with_StreamHandler(self):
- # Test that traceback only appends once (bpo-34334).
+ # Test that traceback and stack-info only appends once (bpo-34334, bpo-46755).
listener = logging.handlers.QueueListener(self.queue, self.root_hdlr)
listener.start()
try:
@@ -3816,8 +3816,10 @@ class QueueHandlerTest(BaseTest):
except ZeroDivisionError as e:
exc = e
self.que_logger.exception(self.next_message(), exc_info=exc)
+ self.que_logger.error(self.next_message(), stack_info=True)
listener.stop()
self.assertEqual(self.stream.getvalue().strip().count('Traceback'), 1)
+ self.assertEqual(self.stream.getvalue().strip().count('Stack'), 1)
@unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'),
'logging.handlers.QueueListener required for this test')