1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

fix test for python 3.6

This commit is contained in:
Kelly Brazil
2022-12-23 09:40:26 -08:00
parent edcca4fb96
commit 44d1d52426

View File

@ -79,6 +79,14 @@ class MyTests(unittest.TestCase):
None: {'string': None, 'format': None, 'naive': None, 'utc': None}
}
# fixup for change in behavior after python 3.6:
# Changed in version 3.7: When the %z directive is provided to the strptime() method,
# the UTC offsets can have a colon as a separator between hours, minutes and seconds.
# For example, '+01:00:00' will be parsed as an offset of one hour. In addition,
# providing 'Z' is identical to '+00:00'.
if sys.version_info < (3, 7, 0):
del datetime_map['2000/01/01-01:00:00.000000+00:00']
for input_string, expected_output in datetime_map.items():
ts = jc.utils.timestamp(input_string)
ts_dict = {