use 'utcfromtimestamp()'

'fromtimestamp()' converts its results to the local timezone and causes
problems when running tests on a different machine.
This commit is contained in:
Mike Fährmann
2019-04-21 16:22:53 +02:00
parent d84e7c6861
commit 6264a46212
3 changed files with 6 additions and 6 deletions

View File

@@ -338,8 +338,8 @@ class TestText(unittest.TestCase):
self.assertEqual(f(value), {})
def test_parse_timestamp(self, f=text.parse_timestamp):
null = datetime.datetime.fromtimestamp(0)
value = datetime.datetime.fromtimestamp(1555816235)
null = datetime.datetime.utcfromtimestamp(0)
value = datetime.datetime.utcfromtimestamp(1555816235)
self.assertEqual(f(0) , null)
self.assertEqual(f("0") , null)