Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec5a2d5

Browse files
committed
test_logging: Changed TimedRotatingFileHandler tests to use UTC time rather than local time.
1 parent d032131 commit ec5a2d5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/test/test_logging.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,13 +2044,13 @@ def secs(**kw):
20442044
('M', 60),
20452045
('H', 60 * 60),
20462046
('D', 60 * 60 * 24),
2047-
('MIDNIGHT', 60 * 60 * 23),
2047+
('MIDNIGHT', 60 * 60 * 24),
20482048
# current time (epoch start) is a Thursday, W0 means Monday
2049-
('W0', secs(days=4, hours=23)),
2049+
('W0', secs(days=4, hours=24)),
20502050
):
20512051
def test_compute_rollover(self, when=when, exp=exp):
20522052
rh = logging.handlers.TimedRotatingFileHandler(
2053-
self.fn, when=when, interval=1, backupCount=0)
2053+
self.fn, when=when, interval=1, backupCount=0, utc=True)
20542054
currentTime = 0.0
20552055
actual = rh.computeRollover(currentTime)
20562056
if exp != actual:

0 commit comments

Comments
 (0)