summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2022-07-05 15:04:29 (GMT)
committerGitHub <noreply@github.com>2022-07-05 15:04:29 (GMT)
commit3287e45847a4d471e20425f0da5194ac5735e16c (patch)
tree527cf60e4b723a503f47c803c38599b01f9e5c7c /Lib/test/test_logging.py
parent5bd56a030ddf19052f23194e7ff95b4b9144f94f (diff)
downloadcpython-3287e45847a4d471e20425f0da5194ac5735e16c.zip
cpython-3287e45847a4d471e20425f0da5194ac5735e16c.tar.gz
cpython-3287e45847a4d471e20425f0da5194ac5735e16c.tar.bz2
[3.10] bpo-46755: Don't log stack info twice in QueueHandler (GH-31355) (GH-94565)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Diffstat (limited to 'Lib/test/test_logging.py')
-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 bdb1e75..af68f25 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -3598,7 +3598,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:
@@ -3606,8 +3606,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')