@@ -32,8 +32,8 @@ def test_humanize_delta_should_normal_usage(self):
3232 (relativedelta (days = 2 , hours = 2 ), "days" , 2 , "2 days" ),
3333 )
3434
35- for delta , precision , max_units , expected in test_cases :
36- with self .subTest (delta = delta , precision = precision , max_units = max_units , expected = expected ):
35+ for i , ( delta , precision , max_units , expected ) in enumerate ( test_cases ) :
36+ with self .subTest (test_case = i , precision = precision , max_units = max_units , expected = expected ):
3737 actual = time .humanize_delta (delta , precision = precision , max_units = max_units )
3838 self .assertEqual (actual , expected )
3939
@@ -57,8 +57,8 @@ def test_format_with_duration_none_expiry(self):
5757 (None , "Why hello there!" , float ("inf" ), None ),
5858 )
5959
60- for expiry , date_from , max_units , expected in test_cases :
61- with self .subTest (expiry = expiry , date_from = date_from , max_units = max_units , expected = expected ):
60+ for i , ( expiry , date_from , max_units , expected ) in enumerate ( test_cases ) :
61+ with self .subTest (test_case = i , expiry = expiry , max_units = max_units , expected = expected ):
6262 self .assertEqual (time .format_with_duration (expiry , date_from , max_units ), expected )
6363
6464 def test_format_with_duration_custom_units (self ):
@@ -70,8 +70,8 @@ def test_format_with_duration_custom_units(self):
7070 "<t:32531918940:f> (6 months, 28 days, 23 hours and 54 minutes)" )
7171 )
7272
73- for expiry , date_from , max_units , expected in test_cases :
74- with self .subTest (expiry = expiry , date_from = date_from , max_units = max_units , expected = expected ):
73+ for i , ( expiry , date_from , max_units , expected ) in enumerate ( test_cases ) :
74+ with self .subTest (test_case = i , max_units = max_units , expected = expected ):
7575 self .assertEqual (time .format_with_duration (expiry , date_from , max_units ), expected )
7676
7777 def test_format_with_duration_normal_usage (self ):
@@ -94,8 +94,8 @@ def test_format_with_duration_normal_usage(self):
9494 (None , datetime (2019 , 11 , 23 , 23 , 49 , 5 , tzinfo = UTC ), 2 , None ),
9595 )
9696
97- for expiry , date_from , max_units , expected in test_cases :
98- with self .subTest (expiry = expiry , date_from = date_from , max_units = max_units , expected = expected ):
97+ for i , ( expiry , date_from , max_units , expected ) in enumerate ( test_cases ) :
98+ with self .subTest (test_case = i , max_units = max_units , expected = expected ):
9999 self .assertEqual (time .format_with_duration (expiry , date_from , max_units ), expected )
100100
101101 def test_until_expiration_with_duration_none_expiry (self ):
@@ -109,8 +109,8 @@ def test_until_expiration_with_duration_custom_units(self):
109109 ("3000-11-23T20:09:00Z" , "<t:32531918940:R>" )
110110 )
111111
112- for expiry , expected in test_cases :
113- with self .subTest (expiry = expiry , expected = expected ):
112+ for i , ( expiry , expected ) in enumerate ( test_cases ) :
113+ with self .subTest (test_case = i , expiry = expiry , expected = expected ):
114114 self .assertEqual (time .until_expiration (expiry ,), expected )
115115
116116 def test_until_expiration_normal_usage (self ):
@@ -123,6 +123,6 @@ def test_until_expiration_normal_usage(self):
123123 ("3000-11-23T20:09:00Z" , "<t:32531918940:R>" ),
124124 )
125125
126- for expiry , expected in test_cases :
127- with self .subTest (expiry = expiry , expected = expected ):
126+ for i , ( expiry , expected ) in enumerate ( test_cases ) :
127+ with self .subTest (test_case = i , expiry = expiry , expected = expected ):
128128 self .assertEqual (time .until_expiration (expiry ), expected )
0 commit comments