mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue #24678: Fixed raiseExceptions typo in logging tests.
Patch by Jacek Kołodziej.
This commit is contained in:
parent
19c1a8725c
commit
750eae1bd4
1 changed files with 6 additions and 11 deletions
|
@ -41,7 +41,8 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from test.script_helper import assert_python_ok
|
from test.script_helper import assert_python_ok
|
||||||
from test.support import (captured_stdout, run_with_locale, run_unittest,
|
from test.support import (captured_stdout, run_with_locale, run_unittest,
|
||||||
patch, requires_zlib, TestHandler, Matcher, HOST)
|
patch, requires_zlib, TestHandler, Matcher, HOST,
|
||||||
|
swap_attr)
|
||||||
import textwrap
|
import textwrap
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
|
@ -3748,18 +3749,12 @@ class LoggerTest(BaseTest):
|
||||||
(exc.__class__, exc, exc.__traceback__))
|
(exc.__class__, exc, exc.__traceback__))
|
||||||
|
|
||||||
def test_log_invalid_level_with_raise(self):
|
def test_log_invalid_level_with_raise(self):
|
||||||
old_raise = logging.raiseExceptions
|
with swap_attr(logging, 'raiseExceptions', True):
|
||||||
self.addCleanup(setattr, logging, 'raiseExecptions', old_raise)
|
self.assertRaises(TypeError, self.logger.log, '10', 'test message')
|
||||||
|
|
||||||
logging.raiseExceptions = True
|
|
||||||
self.assertRaises(TypeError, self.logger.log, '10', 'test message')
|
|
||||||
|
|
||||||
def test_log_invalid_level_no_raise(self):
|
def test_log_invalid_level_no_raise(self):
|
||||||
old_raise = logging.raiseExceptions
|
with swap_attr(logging, 'raiseExceptions', False):
|
||||||
self.addCleanup(setattr, logging, 'raiseExecptions', old_raise)
|
self.logger.log('10', 'test message') # no exception happens
|
||||||
|
|
||||||
logging.raiseExceptions = False
|
|
||||||
self.logger.log('10', 'test message') # no exception happens
|
|
||||||
|
|
||||||
def test_find_caller_with_stack_info(self):
|
def test_find_caller_with_stack_info(self):
|
||||||
called = []
|
called = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue