mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
bpo-46755: Don't log stack info twice in QueueHandler (GH-31355)
This commit is contained in:
parent
324d01944d
commit
c60f125533
4 changed files with 8 additions and 3 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue