mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #11330: Updated tests for correct asctime handling.
This commit is contained in:
parent
ed0473cfaf
commit
89807a5277
2 changed files with 10 additions and 2 deletions
|
@ -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='$')
|
||||
|
@ -2097,7 +2105,7 @@ def test_main():
|
|||
LogRecordFactoryTest, ChildLoggerTest, QueueHandlerTest,
|
||||
RotatingFileHandlerTest,
|
||||
LastResortTest,
|
||||
#TimedRotatingFileHandlerTest
|
||||
TimedRotatingFileHandlerTest
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue