diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-07-21 19:40:18 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-07-21 19:40:18 (GMT) |
commit | 296b347db7c68b1a2aadda34ddf83c93eed0ad83 (patch) | |
tree | f16f120e64303498a5b0e15a3835fb957ea1de3a /Lib/test | |
parent | e4e811d65b51478392a7c69e83b38c6930012eb7 (diff) | |
parent | 750eae1bd4a25dc1d3895b4757d22a6acf262ae9 (diff) | |
download | cpython-296b347db7c68b1a2aadda34ddf83c93eed0ad83.zip cpython-296b347db7c68b1a2aadda34ddf83c93eed0ad83.tar.gz cpython-296b347db7c68b1a2aadda34ddf83c93eed0ad83.tar.bz2 |
Issue #24678: Fixed raiseExceptions typo in logging tests.
Patch by Jacek KoĆodziej.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_logging.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 07aeb83..b6e64ce 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -3779,18 +3779,12 @@ class LoggerTest(BaseTest): (exc.__class__, exc, exc.__traceback__)) def test_log_invalid_level_with_raise(self): - old_raise = logging.raiseExceptions - self.addCleanup(setattr, logging, 'raiseExecptions', old_raise) - - logging.raiseExceptions = True - self.assertRaises(TypeError, self.logger.log, '10', 'test message') + with support.swap_attr(logging, 'raiseExceptions', True): + self.assertRaises(TypeError, self.logger.log, '10', 'test message') def test_log_invalid_level_no_raise(self): - old_raise = logging.raiseExceptions - self.addCleanup(setattr, logging, 'raiseExecptions', old_raise) - - logging.raiseExceptions = False - self.logger.log('10', 'test message') # no exception happens + with support.swap_attr(logging, 'raiseExceptions', False): + self.logger.log('10', 'test message') # no exception happens def test_find_caller_with_stack_info(self): called = [] |