Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2dad9601
Commit
2dad9601
authored
Apr 07, 2019
by
Xtreak
Committed by
Vinay Sajip
Apr 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-35726: Add test for QueueHandler with multiple handlers (GH-11659)
parent
89a89440
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
Lib/test/test_logging.py
Lib/test/test_logging.py
+13
-0
No files found.
Lib/test/test_logging.py
View file @
2dad9601
...
...
@@ -3505,6 +3505,19 @@ class QueueHandlerTest(BaseTest):
listener.stop()
self.assertEqual(self.stream.getvalue().strip().count('Traceback'), 1)
@unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'),
'logging.handlers.QueueListener required for this test')
def test_queue_listener_with_multiple_handlers(self):
# Test that queue handler format doesn't affect other handler formats (bpo-35726).
self.que_hdlr.setFormatter(self.root_formatter)
self.que_logger.addHandler(self.root_hdlr)
listener = logging.handlers.QueueListener(self.queue, self.que_hdlr)
listener.start()
self.que_logger.error("
error
")
listener.stop()
self.assertEqual(self.stream.getvalue().strip(), "
que
->
ERROR
:
error
")
if hasattr(logging.handlers, 'QueueListener'):
import multiprocessing
from unittest.mock import patch
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment