]> granicus.if.org Git - python/commitdiff
Issue #292Merged fixes from 3.5.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Wed, 11 Jan 2017 17:41:28 +0000 (17:41 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Wed, 11 Jan 2017 17:41:28 +0000 (17:41 +0000)
1  2 
Lib/logging/__init__.py
Lib/test/test_logging.py

Simple merge
index 079f58482a0aeafe44e40f705736c1a40e29cef3,1c850456b14d497bd6c549452362e7c1afe7fd68..9dedc098ba5acae0e49a1768058bc1bcc39cd851
@@@ -309,10 -308,14 +309,18 @@@ class BuiltinLevelsTest(BaseTest)
          self.assertEqual(logging.getLevelName('INFO'), logging.INFO)
          self.assertEqual(logging.getLevelName(logging.INFO), 'INFO')
  
 +    def test_issue27935(self):
 +        fatal = logging.getLevelName('FATAL')
 +        self.assertEqual(fatal, logging.FATAL)
 +
+     def test_regression_29220(self):
+         """See issue #29220 for more information."""
+         logging.addLevelName(logging.INFO, '')
+         self.addCleanup(logging.addLevelName, logging.INFO, 'INFO')
+         self.assertEqual(logging.getLevelName(logging.INFO), '')
+         self.assertEqual(logging.getLevelName(logging.NOTSET), 'NOTSET')
+         self.assertEqual(logging.getLevelName('NOTSET'), logging.NOTSET)
  class BasicFilterTest(BaseTest):
  
      """Test the bundled Filter class."""