diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index f9da87b6f1f..85c5312053c 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -1907,6 +1907,8 @@ class FormatterTest(unittest.TestCase): self.assertFalse(f.usesTime()) f = logging.Formatter('%(asctime)s') self.assertTrue(f.usesTime()) + f = logging.Formatter('%(asctime)-15s') + self.assertTrue(f.usesTime()) f = logging.Formatter('asctime') self.assertFalse(f.usesTime()) @@ -1920,6 +1922,10 @@ class FormatterTest(unittest.TestCase): self.assertFalse(f.usesTime()) f = logging.Formatter('{asctime}', style='{') self.assertTrue(f.usesTime()) + f = logging.Formatter('{asctime!s:15}', style='{') + self.assertTrue(f.usesTime()) + f = logging.Formatter('{asctime:15}', style='{') + self.assertTrue(f.usesTime()) f = logging.Formatter('asctime', style='{') self.assertFalse(f.usesTime()) @@ -1935,6 +1941,8 @@ class FormatterTest(unittest.TestCase): self.assertFalse(f.usesTime()) f = logging.Formatter('${asctime}', style='$') self.assertTrue(f.usesTime()) + f = logging.Formatter('${asctime', style='$') + self.assertFalse(f.usesTime()) f = logging.Formatter('$asctime', style='$') self.assertTrue(f.usesTime()) f = logging.Formatter('asctime', style='$')