@@ -60,55 +60,6 @@ def _normalize_distribution_name(name):
6060 return re .sub (r"[-_.]+" , "-" , name ).lower ()
6161
6262
63- @pytest .mark .parametrize (
64- ("input_str" , "expected_output" ),
65- (
66- (
67- "2021-01-01T00:00:00.000000Z" ,
68- datetime (2021 , 1 , 1 , tzinfo = timezone .utc ),
69- ), # UTC time
70- (
71- "2021-01-01T00:00:00.000000" ,
72- datetime (2021 , 1 , 1 ).astimezone (timezone .utc ),
73- ), # No TZ -- assume local but convert to UTC
74- (
75- "2021-01-01T00:00:00Z" ,
76- datetime (2021 , 1 , 1 , tzinfo = timezone .utc ),
77- ), # UTC - No milliseconds
78- (
79- "2021-01-01T00:00:00.000000+00:00" ,
80- datetime (2021 , 1 , 1 , tzinfo = timezone .utc ),
81- ),
82- (
83- "2021-01-01T00:00:00.000000-00:00" ,
84- datetime (2021 , 1 , 1 , tzinfo = timezone .utc ),
85- ),
86- (
87- "2021-01-01T00:00:00.000000+0000" ,
88- datetime (2021 , 1 , 1 , tzinfo = timezone .utc ),
89- ),
90- (
91- "2021-01-01T00:00:00.000000-0000" ,
92- datetime (2021 , 1 , 1 , tzinfo = timezone .utc ),
93- ),
94- (
95- "2020-12-31T00:00:00.000000+02:00" ,
96- datetime (2020 , 12 , 31 , tzinfo = timezone (timedelta (hours = 2 ))),
97- ), # UTC+2 time
98- (
99- "2020-12-31T00:00:00.000000-0200" ,
100- datetime (2020 , 12 , 31 , tzinfo = timezone (timedelta (hours = - 2 ))),
101- ), # UTC-2 time
102- (
103- "2020-12-31T00:00:00-0200" ,
104- datetime (2020 , 12 , 31 , tzinfo = timezone (timedelta (hours = - 2 ))),
105- ), # UTC-2 time - no milliseconds
106- ),
107- )
108- def test_datetime_from_isoformat (input_str , expected_output ):
109- assert datetime_from_isoformat (input_str ) == expected_output , input_str
110-
111-
11263@pytest .mark .parametrize (
11364 "env_var_value,strict,expected" ,
11465 [
0 commit comments