Skip to content

Commit 93c526f

Browse files
authored
Fix test_resize_with_aggregate on non-UTC systems (#322)
Use datetime.utcnow() instead of .now() to calculate the UTC timestamp without it being affected by the local timezone. This fixes the test failure on systems running non-UTC timezone. Fixes #321
1 parent 3ce395e commit 93c526f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test_whisper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ def test_resize_with_aggregate(self):
819819
whisper.create(self.filename, retention)
820820

821821
# insert data
822-
now_timestamp = int((datetime.now() - datetime(1970, 1, 1)).total_seconds())
822+
now_timestamp = int((datetime.utcnow() - datetime(1970, 1, 1)).total_seconds())
823823
now_timestamp -= now_timestamp % 60 # format timestamp
824824
points = [(now_timestamp - i * 60, i) for i in range(0, 60 * 24 * 2)]
825825
whisper.update_many(self.filename, points)

0 commit comments

Comments
 (0)