diff --git a/datascout/tests/test_timeconversion.py b/datascout/tests/test_timeconversion.py index 8f71426b93dcfc6a7f3d4cb95c535fa92b27aeea..a77249478e9f12addf3b6c5a533883a9453a76cf 100644 --- a/datascout/tests/test_timeconversion.py +++ b/datascout/tests/test_timeconversion.py @@ -7,15 +7,15 @@ import datetime def test_time(): reference_stamp = 1645617457640238425 - reference_time = datetime.datetime(2022, 2, 23, 12, 57, 37, 640238) + reference_time = datetime.datetime(2022, 2, 23, 11, 57, 37, 640238, tzinfo=datetime.timezone.utc) myDateTime_utc = ds.unixtime_to_datetime(reference_stamp, time_zone = 'utc') myDateTime_local = ds.unixtime_to_datetime(reference_stamp, time_zone = 'local') myDateTime_cern = ds.unixtime_to_datetime(reference_stamp, time_zone = 'CERN') myDateTime_unaware = ds.unixtime_to_datetime(reference_stamp, time_zone = None) - # the unaware time should be as the ref time created above - assert (myDateTime_unaware == reference_time) + # those should be the same + assert (myDateTime_utc == reference_time) # Note that datetime object are precise only down to the microsecond! reference_stamp_us_precision = round(reference_stamp/1000.)*1000