From 44d1d52426714e2c4014cae755ea1a55645727c7 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 23 Dec 2022 09:40:26 -0800 Subject: [PATCH] fix test for python 3.6 --- tests/test_jc_utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_jc_utils.py b/tests/test_jc_utils.py index e32263b3..bfd051e7 100644 --- a/tests/test_jc_utils.py +++ b/tests/test_jc_utils.py @@ -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 = {