mirror of https://github.com/python/cpython
Issue #11852: Merge fix from 3.2.
This commit is contained in:
commit
cd5a2bd48e
|
@ -26,6 +26,8 @@ To use, simply 'import logging.handlers' and log away!
|
||||||
|
|
||||||
import logging, socket, os, pickle, struct, time, re
|
import logging, socket, os, pickle, struct, time, re
|
||||||
from stat import ST_DEV, ST_INO, ST_MTIME
|
from stat import ST_DEV, ST_INO, ST_MTIME
|
||||||
|
import queue
|
||||||
|
import threading
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import codecs
|
import codecs
|
||||||
|
|
|
@ -41,6 +41,7 @@ import struct
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from test.support import captured_stdout, run_with_locale, run_unittest, patch
|
from test.support import captured_stdout, run_with_locale, run_unittest, patch
|
||||||
|
from test.support import TestHandler, Matcher
|
||||||
import textwrap
|
import textwrap
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
import warnings
|
||||||
|
@ -2108,6 +2109,21 @@ class QueueHandlerTest(BaseTest):
|
||||||
self.assertEqual(data.name, self.que_logger.name)
|
self.assertEqual(data.name, self.que_logger.name)
|
||||||
self.assertEqual((data.msg, data.args), (msg, None))
|
self.assertEqual((data.msg, data.args), (msg, None))
|
||||||
|
|
||||||
|
def test_queue_listener(self):
|
||||||
|
handler = TestHandler(Matcher())
|
||||||
|
listener = logging.handlers.QueueListener(self.queue, handler)
|
||||||
|
listener.start()
|
||||||
|
try:
|
||||||
|
self.que_logger.warning(self.next_message())
|
||||||
|
self.que_logger.error(self.next_message())
|
||||||
|
self.que_logger.critical(self.next_message())
|
||||||
|
finally:
|
||||||
|
listener.stop()
|
||||||
|
self.assertTrue(handler.matches(levelno=logging.WARNING, message='1'))
|
||||||
|
self.assertTrue(handler.matches(levelno=logging.ERROR, message='2'))
|
||||||
|
self.assertTrue(handler.matches(levelno=logging.CRITICAL, message='3'))
|
||||||
|
|
||||||
|
|
||||||
class FormatterTest(unittest.TestCase):
|
class FormatterTest(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.common = {
|
self.common = {
|
||||||
|
|
|
@ -110,6 +110,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #11852: Add missing imports and update tests.
|
||||||
|
|
||||||
- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
|
- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
|
||||||
specific part only digits. Patch by Santoso Wijaya.
|
specific part only digits. Patch by Santoso Wijaya.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue