]> granicus.if.org Git - python/commitdiff
Issue #24678: Fixed raiseExceptions typo in logging tests.
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 21 Jul 2015 19:40:18 +0000 (22:40 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Tue, 21 Jul 2015 19:40:18 +0000 (22:40 +0300)
Patch by Jacek KoƂodziej.

1  2 
Lib/test/test_logging.py

index 07aeb8386af8a413f33faefc8dcf06a708de6344,ddab2e0ecd53a01d1f6e391fcbcdf434970b82f3..b6e64ce91fa7a79895aef152be341defb14266de
@@@ -3779,18 -3749,12 +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 swap_attr(logging, 'raiseExceptions', True):
++        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 swap_attr(logging, 'raiseExceptions', False):
++        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 = []